[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Having Grub2 use UUID instead of (hd0,1)?

On Fri, Dec 25, 2009 at 05:19:13PM EST, Nate Bargmann wrote:
> Is it possible to tell Grub2 to use the UUID of the partition
> /boot/grub resides instead of its default (hd0,1) notation?  The reason
> I ask is that I am using a custom kernel that treats all drives as sda,
> but Debian's Grub2 pukes on it.  Specifically, installing and updating
> Grub results in "/dev/sda" in /boot/grub.cfg and then boot fails as
> grub evidently sees it as an IDE drive, which it is.  It seems as
> though if Grub could use UUI internally as the kernel does, this issue
> would be resolved.  So far my Googler has come up empty.
> - Nate >>

# vol_id¹ --UUID /dev/sda1     # or whatever ..

Add this to /etc/grub.d/40_custom

search --no-floppy --fs-uuid --set fb796a23-e59e-4e15-ba92-15f0cd087714²
linux /boot/vmlinuz-2.6.26-1-686 root=UUID=fb796a23-e59e-4e15-ba92-15f0cd087714² ro
initrd /boot/initrd.img-2.6.26-1-686

# update-grub³

Nowhere is there any /dev/xxxx in the above and it works on my system.


¹ That's the command I use on 'lenny' - I had to use something else on a
  more recent system .. not sure what .. blkid, maybe?

² Replace by the output of vol_id --UUID

³ Or print the sample above and UUID and enter the commands manually via
  the grub2 editor

Reply to: