Does grub2 have a means of selecting a menu entry by a unique label instead of the current numbering system which results in commands like grub-reboot '1>3', GRUB_DEFAULT="1", GRUB_DEFAULT="1>3"?

What I have in mind are more line the UUIDs used for selecting partitions to boot from, rather than expressions like (hd0,1), (hd1,1) etc. I would prefer to enter random UUIDs in the menu entries and use GRUB_DEFAULT="MENUID=2XDR" rather than numbered entries which are hard to compute?


Set the exact name from the menuentry as GRUB_DEFAULT, for example Ubuntu, with Linux 4.4.0-62-generic (upstart), see:

perl -lne "print \$1 if /menuentry '(.*?)'/" /boot/grub/grub.cfg
  • Debian has a habit of using duplicate names for different installations of the same OS even if they are different versions. I want to use the UUID of the root partition for GRUB_DEFAULT as it is bound to be unique.
    – vfclists
    Jul 14 '19 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.