2

While most questions about GRUB2 are about it not detecting such and such OS, I want on the contrary to stop GRUB2 from interacting with everything on my machine.

Context & Problem

The problem appears when I configure a new Linux install on a disk (let's call it /dev/sdb) by chrooting to it from another install on another disk (/dev/sda). I am chrooted into the new system and run:

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Void Linux [GRUB]" --recheck

I am following the set of instructions from Void Linux Wiki by the way.

After running the command, my BIOS sees the new disk but no longer the old one. I can patch things up afterwards by chrooting into the old system from the new one and reinstall GRUB2 from there. Afterwards, the BIOS sees both disks independently. This is of course an unsatisfactory fix.

Note

  • The bootloader-id is different from one disk to another, so the problem does not come from there.
  • I use the following /etc/default/grub, I tried adding GRUB_DISABLE_OS_PROBER=true (without success).
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_DISTRIBUTOR="Void"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4 slub_debug=P page_poison=1 rd.auto=1"
GRUB_DISABLE_OS_PROBER=true

1 Answer 1

2

There is no need for chroot. Mounting the ESP prior to running grub-install should be sufficient. grub-install should pick it up automagically. Use --no-nvram to leave EFI variables untouched.

grub-install --target=x86_64-efi --bootloader-id="Void Linux [GRUB]" --no-nvram /dev/sdb

/etc/default/grub is not used by grub-install. It is only relevant for grub-mkconfig. You did not mention grub-mkconfig, so I assume an unconfigured GRUB2 installation is what you are asking for.

1
  • Thanks. --no-nvram does the trick of not clobbering the old setup. Aug 6, 2019 at 9:54

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.