6

I don't want grub to "search" for anything. I know where my root file system is, and it will always be there (/dev/sda1), and I don't want grub to go looking at all the connected drives to find some other root (it seems to always finds the wrong one).

I have been able to disable UUID use in the kernel-loading line with:

GRUB_DISABLE_LINUX_UUID=true

in /etc/default/grub, but the resulting /boot/grub/grub.cfg still has lines like:

search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3f8c2b36-5d8f-40ac-9b63-7d1445805925

and I don't want those. I don't want it to search at all. I further turned off "os-probing" with:

GRUB_DISABLE_OS_PROBER=true

which keeps it from finding backup copies of my system on other attached disks, but I don't want ANY instance of the "search" command in grub, let alone with UUIDs that I already told it not to use.

I hate grub. I just want my machine to boot with root=/dev/sda1, without probing all over my system, without looking for UUIDs that might not be there, without anything. Like it used to boot in 1999, with LILO.

I would actually use LILO or syslinux or something if it weren't for the fact that Ubuntu uses grub, and therefore if I want to be able to keep up with their kernel updates, I'm pretty much forced to use it. I just want it to be the simplest configuration humanly possible (which I know is still going to result in a 200-line grub.cfg, but oh well).

migrated from serverfault.com Jun 9 '17 at 15:03

This question came from our site for system and network administrators.

3

That's how grub-mkconfig works: it automatically creates GRUB menu entries for every kernel it discovers. However, if you know what you want and what you are doing, you don't need to use Simple configuration at all, as you can write your grub.cfg directly.

grub-mkconfig does have some limitations. While adding extra custom menu entries to the end of the list can be done by editing /etc/grub.d/40_custom or creating /boot/grub/custom.cfg, changing the order of menu entries or changing their titles may require making complex changes to shell scripts stored in /etc/grub.d/. This may be improved in the future. In the meantime, those who feel that it would be easier to write grub.cfg directly are encouraged to do so (see Booting, and Shell-like scripting), and to disable any system provided by their distribution to automatically run grub-mkconfig.

There, you could have only a single menu entry (disabling the menu) with as simple settings as you wish. You can tell that you want to boot this kernel from here and that's it.

A single menuentry { } can be like 5 lines, not 200.

Keep in mind:

  • Test your custom menu entry first by adding it to custom entries.
  • If you disable grub-mkconfig from your system you'll need to update your grub.cfg manually whenever you want to update your kernel.

Your Answer

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