My motherboard is the following model with the latest bios: https://www.asus.com/us/Motherboards/CROSSHAIR_V_FORMULAZ/

I followed the standard Arch Linux instructions for configuring the EFI to boot using the kernel as an EFISTUB. This is something that had worked fine for me for over a year on the same hardware but when i tried to change my kernel parameters I seemed to have broken something. None of the usual approaches worked.

First I tried using the efibootmgr with the following command:

efibootmgr -d /dev/sda -p 1 -b 0000 -g -c -l \vmlinuz-linux -L "Linux" -u "root=/dev/mapper/default-root rw initrd=initramfs-linux.img"

this added the following entry revealed using efibootmgr -v

Boot0000* Linux HD(1,GPT,76dd039b-764a-4b07-81ed-61921dfdab62,0x800,0x800)/File(\vmlinuz-linux)r.o.o.t.=./.d.e.v./.m.a.p.p.e.r./.d.e.f.a.u.l.t.-.r.o.o.t. .r.w. .i.n.i.t.r.d.=./.i.n.i.t.r.a.m.f.s.-.l.i.n.u.x...i.m.g.

When I try to boot to this entry I get a BIOS level error that no bootable devices can be found.

Next I tried using the bcfg tool in the live CD's UEFI shell v2.

For this I had to create a kernel-opts text file on /boot therefore I executed the following.

echo "boot=/dev/mapper/default-root rw initrd=initramfs-linux.img > /boot/kernel-opts

I then booted up the UEFI Shell v2 from the live CD and in the shell I executed the following.

bcfg boot add 0 fs1:\vmlinuz-linux "Arch Linux"
bcfg boot -opt 0 fs1:\kernel-opts

Using efibootmgr -v I again inspected the new entry.

Boot0000* Arch Linux    PciRoot(0x0)/Pci(0x4,0x0)/Pci(0x0,0x0)/Sata(0,65535,0)/HD(2,GPT,5cec78ae-39af-4434-9b57-9c08b8032147,0x1000,0x200000)/File(\vmlinuz-linux)root=/dev/mapper/default-root rw initrd=\initramfs-linux.img

This time when booting the boot device is detected but a kernel panic ensues when it can't find the root fs.

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.11.3-1-ARCH #1

I had concluded that the bcfg was getting the first part correct, the location of the kernel, but the arguments were incorrect, specifically because they weren't encoded in unicode. I tried several variations of arguments for each tool but I couldn't get ether tool to work as-is.


Ultimately I found a solution, but it feels like a hack. I just wanted to post it here for others until a better solution comes around.

By converting the kernel-opts file from the question into UTF-16 (unicode) and using that instead I was able to solve the problem. I also had to drop the first two bytes of the converted file; not sure why iconv adds those bytes. I used the following command to convert to UTF-16.

iconv -f ASCII -t UTF-16 kernel-opts | dd bs=1 skip=2 > kernel-opts-unicode

Next I deleted the old boot entries, booted back to the Live CD's UEFI Shell v2 and executed the following commands.

bcfg boot add 0 fs1:\vmlinuz-linux "Arch Linux"
bcfg boot -opt 0 fs1:\kernel-opts-unicode

This produced the following entry according to efibootmgr -v

Boot0000* Arch Linux    PciRoot(0x0)/Pci(0x4,0x0)/Pci(0x0,0x0)/Sata(1,65535,0)/HD(2,GPT,e5f7abe4-75bf-4c63-a76b-504c17eb5460,0x1000,0x200000)/File(\vmlinuz-linux)r.o.o.t.=./.d.e.v./.m.a.p.p.e.r./.d.e.f.a.u.l.t.-.r.o.o.t. .r.w. .i.n.i.t.r.d.=.\.i.n.i.t.r.a.m.f.s.-.l.i.n.u.x...i.m.g.

The system was then able to boot without any warnings or errors.

  • If you have, as you said in the question, used exactly the same method in the past, then you may have run into a new in efibootmgr, or at least a change in the way it works. Perhaps the -u option is no longer doing what it had been doing, for instance. – Rod Smith Jun 12 '17 at 1:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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