How to force update-grub to use UUID?

6,110

GRUB_DISABLE_LINUX_UUID=true in /etc/default/grub forces GRUB to not use UUIDs. If it is present in yours, delete it or comment it out and rerun update-grub.

Share:
6,110

Related videos on Youtube

user276851
Author by

user276851

Updated on September 18, 2022

Comments

  • user276851
    user276851 over 1 year

    When I run "update-grub", the file "grub.cfg" will contain lines like this.

    menuentry 'Ubuntu...' {
        ...
        linux /boot/vmlinuz... root=/dev/md124 ...
        ...
    }
    

    For the line of linux, is it possible to let it use UUID? Like,

        linux /boot/vmlinux... root=UUID=xxx
    

    Right now, every time after I do update-grub, I have to manually edit the line to use UUID. Otherwise, the boot will fail.

    Thanks for the help.

  • Jay Sullivan
    Jay Sullivan about 9 years
    Confused...mine has the (already commented) line #GRUB_DISABLE_LINUX_UUID=true. Is this what you're referring to? It says "Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux". So I'm confused, because it's commented, and I'm getting root=/dev/sda1 style output.
  • fkraiem
    fkraiem about 9 years
    @notfed Even if this line is commented out, there may be other reasons which prevent GRUB from using UUIDs, for example if it is unable for some reason to determine the correct UUID to use.
  • fkraiem
    fkraiem about 9 years
    And yes, I see that my answer was actually wrong, the line forces GRUB to not use UUIDs, otherwise it will use them if possible. I will edit.