# Specify grub root with uuid?

## Philippe23

Grub disagrees with my kernel over drive ordering.  I'd like to move both to UUIDs or Labels.  I know how to do so with the kernel parameter, but I do not know how to do so with the grub root command:

title=Gentoo Linux (3.8.3) Custom Kernel (new-drive)

root (hd1,3)

kernel /boot/kernel-3.8.3-hardened root=/dev/sdb4

Anyone know how?

----------

## Maitreya

IIRC grub 0.97 can do this with an initrd for normal partitions. 

title=Gentoo Linux (3.8.3) Custom Kernel (new-drive) 

kernel /boot/kernel-3.8.3-hardened realroot=SOME-RIDICULOUS-STRING-01234

initrd /boot/initramfs-3.8.3-hardened

And without for GPT partitions.

title=Gentoo Linux (3.8.3) Custom Kernel (new-drive) 

kernel /boot/kernel-3.8.3-hardened root=PARTUUID=SOME-RIDICULOUS-STRING-01234

----------

## Philippe23

Yeah, that's the kernel options, an argument to the kernel that's resolved by the kernel.  The part I don't know is how to change the bold+italic line in my post, the one that tells GRUB where to find kernel itself.  "(hd1,3)" is the part I'd like to replace.

----------

## s4e8

If /boot/grub and /boot/ live on same partition, you don't need the bold+italic line.

----------

## baragoon

use labels fo filesystems

```
# cat /media/GENTOO_USB_BOOT/grub/device.map 

(hd0)   LABEL=GENTOO_USB_ROOT
```

```
# cat /media/GENTOO_USB_BOOT/grub/grub.conf

default 0

timeout 10

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo Linux 3.7.10

root (hd0,0)

kernel /boot/kernel-genkernel-x86_64-3.7.10-gentoo root=/dev/ram0 real_root=LABEL=GENTOO_USB_ROOT rootfstype=ext4 elevator=noop

initrd /boot/initramfs-genkernel-x86_64-3.7.10-gentoo
```

----------

## py-ro

Legacy Grub can't handle UUID for it self, you would need to upgrade to grub2.

Bye

Py

----------

