I want to generate a grub.conf that will search for my /dev/sda1 based on the filesystem label, not the UUID.
I did change /etc/default/grub to so that GRUB_DISABLE_LINUX_UUID="true" and I regenerated grub.cfg.
But I want to go one step further and change the search statements. I notice they still reference the old UUID. I also know grub2 can search by label. Can anyone tell me how to do this? Thanks.
I could use some help understanding this page:
— Command: search [--file|--label|--fs-uuid] [--set var] [--no-floppy] name
Search devices by file (-f, --file), filesystem label (-l, --label), or filesystem UUID (-u, --fs-uuid).
If the --set option is used, the first device found is set as the value of environment variable var. The default variable is ‘root’.
The --no-floppy option prevents searching floppy devices, which can be slow.
The ‘search.file’, ‘search.fs_label’, and ‘search.fs_uuid’ commands are aliases for ‘search --file’, ‘search --label’, and ‘search --fs-uuid’ respectively.
I'd like my grub.cfg to contain statements similar to this:
search --no-floppy --label MyLabel --set root
linux /boot/vmlinuz-2.6.3x-xx-generic root=LABEL=MyLabel ro quiet splash
Assuming that's the right syntax, how do I make grub2 generate label-based
menu entries like that?