4

I've installed a new motherboard into my server (SuperMicro X9DRi-F) and I'm trying to install a fresh copy of Debian 10. However, when it tries to install GRUB it fails:

Unable to install GRUB in dummy
Executing 'grub-install dummy' failed.
This is a fatal error.

I'm making sure to boot the installer (USB drive) in UEFI mode because I'm entering the BIOS and forcing it to boot (which correctly displays "UEFI: Sandisk").

I can't cut and paste the /var/log/syslog message but here is basically what it says:

Installing grub on 'dummy'
grub-install does not support --no-floppy
Running chroot /target grub-install  --force "dummy"
Installing for x86_64-efi platform.
grub-install: warning: Cannot read EFI Boot* variables.
grub-install: warning: read_file: could not read from file: Input/output error.
grub-install: warning: vars_get_variable: read_file(...) failed: Input/output error.

I've searched and I see others with this problem but it's not clear how anybody has solved it?

Can anybody help me out?

2
  • Try posting a debian bug on this (and add a link to it here), this isn't something familiar to me -- and I've added UEFI support into ALT Linux. I'd probably try chrooting into the system being installed at that very stage and running grub-install --recheck -v. Maybe something here helps: rodsbooks.com/efi-bootloaders Sep 13, 2019 at 8:33
  • PS: does /sys/firmware/efi/ directory exist in chroot with system being installed at that stage? Maybe /sys is just not mounted there, although that would be so silly... Sep 13, 2019 at 8:35

3 Answers 3

2

had same problem during re-installation of grub on my system. My solution (chrooted into with debian live system):

~ # mount /dev/sdX /target
~ # mount -o rbind /dev /target/dev
~ # mount -t proc proc /target/proc
~ # mount -t sysfs sys /target/sys
~ # mount -t efivarfs efivarfs /target/sys/firmware/efi/efivars # added that line (in difference to all other manuals found on the internet..)
~ # chroot /target/
~ # grub-install
~ # update-grub
1
  • everything you wrote is fine just 2sinx missing: Oct 31, 2021 at 19:45
0

I am also encountering this error and I suppose I will have to manually install grub some other way. Here is more info: I am in UEFI mode installing on top of a GPT tabled drive, with BTRFS as the root filesystem.

My hard drive is an NVME samsung 970 evo https://pcpartpicker.com/product/JLdxFT/samsung-970-evo-10tb-m2-2280-solid-state-drive-mz-v7e1t0baw

My motherboard is Asus PRIME B360M-A https://pcpartpicker.com/product/WfF48d/asus-prime-b360m-a-micro-atx-lga1151-motherboard-prime-b360m-a

For lack of a Linux system, I have created my usb installation media with Rufus on a Windows 10 system.

I followed directions here, https://wiki.debian.org/GrubEFIReinstall

1.) install efi debian, and when you encounter the grub error, opt to install without bootloader (you must boot your install media in efi mode)

2.) write refind to some boot media (you can overwrite the same media from step 1), boot it in efi, and then boot into the debian system you just installed

3.) open a terminal/shell and login

4.) ensure you in fact booted in efi mode, [ -d /sys/firmware/efi ] && echo "efi, continue" || echo "no efi, reboot in efi"

5.) check that your efi partition is mounted in /boot/efi (it should be, just run lsblk to verify)

6.) sudo grub-install

7.) sudo update-grub

8.) shutdown, remove your boot media from the previous steps, power on and see your system boot from hard drive

That should do it, pretty simple fix.

P.S. Note that I use sudo by skipping root user creation in the install phase - if you prefer su root, then use that from step 3 on.

1
  • What the hack is going on with Debian!? its 2020 Dec 15, 2020 at 1:25
0

Thank you David! This is basically a copy of your answer. I added a few details and omissions which may not be obvious to beginners. I could not install Debian 10 Buster (single boot), even taking everything by default! I have been roaming the net for a solution and only yours was clear and simple enough to WORK for me. We shall assume that /dev/sdX1 is EFI partition and /dev/sdX2 is ext4 with just installed (but not booting) Debian Buster. Also assume that the installation was continued after grub installation failed. Now we have just booted into the live system and brought up a terminal:

~ # sudo mkdir /target
~ # sudo mount /dev/sdX2 /target
~ # sudo mount /dev/sdX1 /target/boot/efi
~ # sudo mount -o rbind /dev /target/dev 
~ # sudo mount -t proc proc /target/proc 
~ # sudo mount -t sysfs sys /target/sys 
~ # sudo mount -t efivarfs efivarfs /target/sys/firmware/efi/efivars 
~ # sudo chroot /target/ 
~ # sudo rm -f /sys/firmware/efi/efivars/dump*
~ # sudo grub-install 
~ # sudo update-grub

Hope it helps, cheers.

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.