You are not logged in.

#1 2013-08-22 23:58:05

subraizada3
Member
Registered: 2013-06-02
Posts: 90

[SOLVED] grub-install command failing for UEFI

I downloaded the 8/2013 iso and burned it with dd. I have an ASUS Rampage IV Extreme motherboard. I was booted into efi mode on both the ISO and in the chroot (the /sys/firmware/efi directory did exist).

I followed the instructions in the Beginner's Guide, but with a 512 MB EFI partition as sda1, 50 GB root as sda2, the rest of my 256 GB SSD as /home, and a 100 GB space on my HDD as /tmp. Everything was ext4 and the EFI partition was a fat32. The EFI partition was mounted on /boot of the new install, as the beginner's guide stated it should be

Everything worked until I get to the part of installing GRUB. Before installing, I again confirmed that /sys/firmware/efi existed. When booting, on the motherboard boot selection screen, it showed 2 options for my USB, one with the name of my drive and another with [UEFI] in front of the drive name. I selected the UEFI option, so I was booted into UEFI mode, and the USB's bootloader also gave options to boot into a UEFI shell instead of the standard Arch ISO bootloader I get on MBR computers (though I did not try those EFI shell options). I looked into te /sys/firmware/efi/efivars directory and it had 2 items in it

Going back to the chroot's / directory, I did the first command in the guide for installing grub (after installing grub and efibootmgr with pacman).

umount /sys/firmware/efi/efivarsk

This gave the error that the directory was not mounted
modprobe -r efivars and modprobe efivars worked correctly (or at least they didn't output any errors).
When I got to

grub-install --efi-directory=/boot --bootloader-id=arch_grub --recheck

it gave this error:

Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.

I searched around on the interwebs and for every other person this problem was occuring because they were booted into BIOS mode instead of UEFI mode, and booting the USB into UEFI mode fixed the problem for them. However, the /sys/firmware/efi directory exists and I made sure to boot into EFI mode in the BIOS.

Are there any other reasons that this could be happening?
Also, is there really any advantage to GPT/EFI booting over GPT/BIOS booting other than a 1-2 second shorter boot time?

Last edited by subraizada3 (2013-08-23 21:10:37)

Offline

#2 2013-08-23 00:29:06

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,156

Re: [SOLVED] grub-install command failing for UEFI

You burnt it to CD?DVD, right? Not dd? Because that won't create an EFI bootable USB key, for example.

modprobe efivars never gives errors (that I've seen). The question is whether the directories are populated. It isn't enough for /sys/firmware/efi to exist. /sys/firmware/efi/vars/ should be full of a *lot* of stuff. In fact /sys/firmware/efi/efivars/ should have lots of stuff before you umount it.

Did you modprobe before arch-chroot? That's essential if the installed kernel is different from the one on the installer (which is very likely).

I think you are confused. There's no such thing as GPT/MBR booting.

GPT and MBR are 2 ways of partitioning disks. GPT has various advantages explained on the wiki page.

EFI and BIOS are 2 ways of booting.

In my personal opinion, if BIOS booting works for you, I'd stick with BIOS. EFI is buggy - why be a guinea pig if you can help it?

Also in my personal opinion, if you can only use GPT in EFI mode, it is worth the hassle to use EFI to reap the benefits of GPT.

At least, those are the decisions I made. Nothing will convince my laptop to boot BIOS mode with a GPT disk. MBR+BIOS is fine but GPT+BIOS is a non-starter. So I use GPT+EFI.  On machines that don't care, I prefer BIOS+GPT.

If you are dual booting Windows, I believe BIOS+GPT may not be an option but I'm not certain of this.

Your kilometres may vary.

By the way, you almost certainly do not want a partition for /tmp unless you are extraordinarily short of RAM and even then...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2013-08-23 00:48:37

subraizada3
Member
Registered: 2013-06-02
Posts: 90

Re: [SOLVED] grub-install command failing for UEFI

That was just a typo, I meant GPT/BIOS. I have done it with Ubuntu on this same system.

Based on what I had read, /tmp is used to store stuff until shutdown and on my previous ubuntu installs it was often full of stuff, and also that video editing/CAD/etc. use /tmp a lot. I wanted to reduce writing to my SSD so I put 100 gigs on my HDD as I had plenty of extra space. I also remember the Arch Wiki page on SSD optimization mentioning a partition.
RAM is of little importance to me, as this system has 64 GB.

I used dd to burn it to a USB. The motherboard's BIOS configuration/boot menu showed it as both BIOS and EFI bootable, and the USB's bootloader looked different from what it is like on BIOS systems. It also contained a bunch of options pertaining to EFI.
Unmounting efivars gave the error that it was never mounted, but when i checked it after issuing umount, it only had 2 items in it. I never looked into .../efi/vars.
I modprobed while I was inside the chroot. I did everything in the order the guide listed.

I have never had any issues with MBR and so the only real benefit of GPT/EFI for me is to shorten boot times, and I will use GPT/BIOS if EFI is too hard to get functional. The reason why I am willing to give it a few more hours is because the ROG motherboards take forever to POST and EFI makes the boot time quite a bit shorter than BIOS.

Last edited by subraizada3 (2013-08-23 00:51:00)

Offline

#4 2013-08-23 00:53:43

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,156

Re: [SOLVED] grub-install command failing for UEFI

You need to modprobe before chroot. Doing it in the chroot will (usually) not work.

Which guide told you to do it in the chroot? Because if the wiki says that somewhere it needs to be corrected.

/tmp uses tmpfs by default. I don't know how that is in Ubuntu but if that is not sufficient, allocate a swap partition or swap file on the HDD. Putting /tmp there in its entirety will slow things down a lot more than booting in BIOS mode.

EDIT: Which .iso did you use? The official iso will not work to create an EFI-bootable USB that way [I thought maybe the unofficial archboot worked this way but the wiki suggests otherwise]. See https://wiki.archlinux.org/index.php/UE … B_from_ISO for instructions.

Last edited by cfr (2013-08-23 00:57:23)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2013-08-23 01:10:26

subraizada3
Member
Registered: 2013-06-02
Posts: 90

Re: [SOLVED] grub-install command failing for UEFI

I used the torrent for the ISO on archlinux.org/downloads.

Here's what the Beginner's Guide on the Arch Wiki says:

GRUB

Install the grub and efibootmgr packages and then run grub-install to install the bootloader:

# pacman -S grub efibootmgr
# umount /sys/firmware/efi/efivars
# modprobe -r efivars
# modprobe efivars
# grub-install --efi-directory=/boot --bootloader-id=arch_grub --recheck

Next, while using a manually created grub.cfg is absolutely fine, it is recommended that beginners automatically generate one:
Tip: To automatically search for other operating systems on your computer, install os-prober (pacman -S os-prober) before running the next command.

# grub-mkconfig -o /boot/grub/grub.cfg

For more information on configuring and using GRUB, see GRUB.

Since the grub package is being installed, I assumed that this was to be done inside the chroot.

As I understand it now, I have to pacstrap, umount efivars, do both modprobes, and then chroot. Inside the chroot I will install grub and efibootmgr, and then grub-install and grub-mkconfig.

Offline

#6 2013-08-23 01:15:42

subraizada3
Member
Registered: 2013-06-02
Posts: 90

Re: [SOLVED] grub-install command failing for UEFI

I remember the Arch Wiki previously saying that /tmp should be on a separate drive to minimize writes but it appears to have been corrected and now says that it is a tmpf equal to half the RAM.

Offline

#7 2013-08-23 01:40:16

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,156

Re: [SOLVED] grub-install command failing for UEFI

You don't need to set up /tmp at all - systemd configures it on boot.

Yes, that's the order. I'm assuming you are using arch-chroot. If you use plain chroot you need to do some additional set up first.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2013-08-23 03:26:09

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED] grub-install command failing for UEFI

There's been a lot of flakiness of late from efibootmgr. I haven't studied the issue in detail, but it seems there have been kernel changes surrounding /sys/firmware/efi, and the version of efibootmgr must match those changes. Furthermore, you may need to have specific kernel options active, including a new filesystem (CONFIG_EFIVAR_FS) built into the kernel (or its module built and loaded).

Rather than deal with these issues, you may want to avoid them. To do so, you should skip the GRUB installation (at least for now) and instead install gummiboot or rEFInd, and use the EFI shell's "bcfg" command to register the boot manager with the firmware. If you use gummiboot, your kernel and initrd must reside on your ESP. rEFInd is more flexible, but the kernel will still need to reside on a FAT, HFS+, ext2/3/4fs, ReiserFS, or Btrfs partition. See the Arch wiki's entry on bcfg for some pointers on using bcfg. Unfortunately, I don't have a step-by-step procedure to do this written up and ready to drop into the Beginner's Guide, so if you try this, you may need to futz with it a bit.

Offline

#9 2013-08-23 18:24:24

subraizada3
Member
Registered: 2013-06-02
Posts: 90

Re: [SOLVED] grub-install command failing for UEFI

I got it working using cfr's solution to umount and modprobe before chrooting.
If I have any more issues with EFI not working, I'm just going to switch to GPT/BIOS.

How am I supposed to mark the thread as solved?

Last edited by subraizada3 (2013-08-23 18:25:14)

Offline

#10 2013-08-23 21:09:17

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,156

Re: [SOLVED] grub-install command failing for UEFI

subraizada3 wrote:

I got it working using cfr's solution to umount and modprobe before chrooting.
If I have any more issues with EFI not working, I'm just going to switch to GPT/BIOS.

Very glad that worked. I am starting to wonder how many of the recent reports about this are due to the wiki. I tried to find somewhere where it got it right but I haven't succeeded so far. The thing is, near the beginning of the month, the instructions will work because the installed modules probably match the running kernel.

How am I supposed to mark the thread as solved?

Edit your initial post and tag the subject line.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB