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

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



* Tom H <tomh0665@gmail.com> [2009 Dec 28 19:55 -0600]:

> >From /usr/lib/grub/grub-mkconfig_lib (which is sourced by all files in
> /etc/grub.d):
> 
> <start>
> # If there's a filesystem UUID that GRUB is capable of identifying, use it;
> # otherwise set root as per value in device.map.
> echo "set root=`${grub_probe} --device ${device} --target=drive`"
> if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2>
> /dev/null`" ; then
> echo "search --no-floppy --fs-uuid --set ${fs_uuid}"
> fi
> <end>
> 
> If you do not want the "set root..." line, comment it out.
> 
> If you want the "set root" line to use UUIDs, change "--target=drive"
> to "--target=fs_uuid" (and possibly add "UUID=" after "root=" like the
> "linux" line).
> 
> You _might_ also have to add an "insmod fs_uuid" line above the "set root=" one.

Interesting and thanks much for the sleuth work.  Seems as though this
should be configurable via /etc/default/grub which may make for a nice
wishlist bug report.  I'll have to check into that.

- Nate >>

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://n0nb.us/index.html


Reply to: