Bookmark and Share

The linux boys came up with a great way to do your boot setup without you having to know
the exact path to your boot device.

This helps with a couple of things.
1. Booting your linux install from usb on *any* machine.
2. Allowing you to always boot from linux even after adding new drives and partitions.

The magic comes from a identifier called UUID. This is just a very large number and for all
your purposes, there will never be a piece of hardware in your machine with the same
number. Thus, this number identifies a piece of your hardware uniquely, which means, using that number your linux system will be able to find the piece of hardware that
corresponds to it.
Now, how do I find the UUID of the drive/partition I'm interested in ?

Enter `blkid`. orion ~ # blkid
/dev/hda1: UUID="d6656d8d-8c3f-49d1-8a59-a943c767bf6a" TYPE="ext3" SEC_TYPE="ext2"
/dev/hda2: UUID="8570c6a2-7bc2-422a-b855-a17af9f8c382" TYPE="ext3"
/dev/hda3: TYPE="swap"

There you go. Now you can identify the partition you need to boot from, from the UUID instead
of what you'll normally use, the device path.

Here's an example config for Grub 2 using UUID:
menuentry "Gentoo Linux" {
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set a362fad5-cfeb-4170-b631-3b01537b9d7f
linux /boot/kernel root=UUID=a362fad5-cfeb-4170-b631-3b01537b9d7f ro video=vesafb:mode=1024x768-32 vga=792 \
initrd /boot/initramfs