# [HOWTO] UUID with Gentoo

## Kasumi_Ninja

UUID can come in handy for those of us who want a fixed entry in fstab for their hard drives and/or removable media. And best off all, it's very easy! Here's how to do it:

1) Make sure you are using an initrd image to boot Gentoo (UUID requires this). if you haven't a initrd image you can create one easily with genkernel:

```
genkernel --install --bootloader=grub --menuconfig --disklabel all
```

2) Find out your devices unique volume id (substitute /dev/sda with your drive):

```
vol_id -u /dev/sda
```

3) Replace the /dev/sd* entries in your fstab with UUID= entries. Example fstab entry:

```
UUID=f28284cc-e994-4b3c-be52-cb45c427f88f       none                    swap            sw                      0 0
```

4)Reboot

----------

## frostschutz

Not sure about 1) in your Howto... UUIDs should work without initrd too.

General issue with uuid/label in gentoo: https://bugs.gentoo.org/show_bug.cgi?id=225669

----------

## NeddySeagoon

Moved from Kernel & Hardware to Documentation, Tips & Tricks.

Looks like it belongs here

----------

## yabbadabbadont

When running genkernel (the latest stable version) you have to include the "--disklabel" option, or the blkid command will not be included in the initramfs image.  (and mounting by label/uuid will fail)

Edit: Also, it is not necessary to use genkernel to build your kernel for this, as long as you include loopback, ramdisk, and initrd support in your kernel, you can use genkernel to only build an initrd.  "genkernel --disklabel initrd"  will only build an initrd image.  You can then use this image with uuid/label mounting.  (this is what I did with my manually configured kernel)

----------

