You are not logged in.

#1 2013-09-21 04:13:31

jayflo
Member
Registered: 2013-09-06
Posts: 33

[Solved] Beginner's Guide UEFI bootloader mixup?

I'm not sure if I've missed something, but while going through the beginner's installation guide there is a statement right before you chroot:

Note: If you are planning to reboot Arch in UEFI mode, read For UEFI motherboards as there are some things to take care of before entering the chroot. This is necessary to ensure the boot loader or manager can be correctly configured within the chroot.

However, clicking on the link takes you to the bootloaders section but the instructions that you need to carry out (for each specified bootloader) before you chroot are not there anymore, e.g.

 umount ...efivars
modprobe -r efivars
modprobe efivars 

Or something like that.  If the linux install has updated to where you do not need to do the pre-chroot commands, then the above quote should be removed to avoid confusion.  If the pre-chroot commands need to be carried out, they should probably be put back in. 

I'm almost sure I saw these commands on the beginner's installation guide just a couple weeks ago...

Last edited by jayflo (2013-09-23 00:00:56)

Offline

#2 2013-09-21 04:17:55

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

The efibootmgr package is now pulled from Peter Jones' repo, which is compatible with the default efivarfs instead to the sysfs-efivar.  So there is not no need to switch between these systems as everything efi related that is included in the Arch repos work off the same thing.

Offline

#3 2013-09-21 04:21:38

jayflo
Member
Registered: 2013-09-06
Posts: 33

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

WonderWoofy wrote:

So there is not no need to switch between these systems as everything efi related that is included in the Arch repos work off the same thing.

Is this saying that the pre-chroot commands are unnecessary?  Should the quote saying that you must take care of things before chroot-ing be removed?

Offline

#4 2013-09-21 06:10:05

vrg
Member
Registered: 2012-06-18
Posts: 36

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

Yes, I also think the quote should be removed if it's not needed anymore.

Also, in the EFISTUB installation part, there is this command:

# efibootmgr -c -d /dev/sdX -p Y -L "Arch Linux" -l /vmlinuz-linux -u "root=PARTUUID=xxxxxxxxxxxxxxxxx rw add_efi_memmap initrd=/initramfs-linux.img"

but there is no explanation of what is the xxxxxxxxxxxxxxxxx. Maybe it should be mentioned that the PARTUUID is not the same as the UUID found in /etc/fstab (which was not obvious to a noob like me), and that it can be obtained with the command

$ ls -l /dev/disk/by-partuuid/

?

Offline

#5 2013-09-21 22:59:17

vrg
Member
Registered: 2012-06-18
Posts: 36

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

As far as I understand, the boot loader configuration for UEFI motherboards can be done either before or after entering the chroot (preferably before), but not from inside the chroot, as the guide seems to suggest. So, maybe I would change the quote to something like this:

Note: If you are planning to boot Arch in UEFI mode, you may want to configure the boot loader as described in For UEFI motherboards before entering the chroot.

Also, the EFISTUB installation instruction I mentioned earlier doesn't quite work in its current form. Three weeks ago there was something else, which worked for me perfectly:

# pacman -S efibootmgr
# umount /sys/firmware/efi/efivars
# modprobe -r efivars
# modprobe efivars
# efibootmgr -c -d /dev/sda -p X -L "Arch Linux" -l /vmlinuz-linux -u "root=/dev/sdaY rw initrd=/initramfs-linux.img"

assuming that the /boot and / partitions are /dev/sdaX and /dev/sdaY, respectively. So, what's wrong with these instructions? Why were they removed?

I'm happy to modify the Beginner's Guide to reflect these changes, but being a beginner myself, I thought I should ask for permission first.

Offline

#6 2013-09-22 02:02:11

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

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

Normally, you configure the boot loader or manager from within the chroot. And efibootmgr is normally run inside the chroot as well. You can use efibootmgr outside the chroot but things like grub will run that automatically anyway and it is at least much easier to install grub within than without the chroot. So I don't think that should be changed.

However, efibootmgr can now use the efivars filesystem. So you no longer need to umount and modprobe before (or after or at any time) chrooting.

Another reason to do this within the chroot is that that way users will definitely have a current version of efibootmgr - even if they are using a slightly older iso. (I'm not sure if the iso includes efibootmgr but if it does, you'd otherwise run the risk of having a too-old version.) Of course, people should use the latest but they don't always or sometimes there's an issue so I think the more fault-tolerant method of running this inside the chroot is best.

This also means that the instructions in the Beginners' Guide for using efibootmgr can be used from any live Linux environment booted in EFI mode (even if the live environment has an older version of efibootmgr or a different version which doesn't support the efivars filesystem). This is sometimes useful and, again, I think it is more straightforward to just say "use efibootmgr in the chroot" for the Beginners' Guide since I can't think of any obvious cases where that wouldn't work but using it outside would, whereas there are several where the reverse is true.

EDIT: But I don't feel strongly about this. It will work outside the chroot as well in the standard case.

Last edited by cfr (2013-09-22 02:04:39)


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

#7 2013-09-22 04:37:01

vrg
Member
Registered: 2012-06-18
Posts: 36

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

Thanks for the reply. I made a  fresh Arch installation yesterday on a new SSD, so this is how I noticed a couple of possible inconsistencies in the guide:

1) I was not able to use efibootmgr inside the chroot because the UEFI variables were apparently not being detected inside the chroot environment.
2) I had to modprobe before using efibootmgr (i.e. as originally suggested in the guide, but not anymore).

I made another Arch installation on the same computer about a month ago and everything worked perfectly, so I did not understand why the guide was changed. Now I understand some of the motivation behind the changes, at least in theory, but in practice it did not work for me.

But anyway, maybe there was something strange about my installation, or maybe this only happens with EFISTUB. I haven't tried using GRUB. I also don't feel so strongly about changing the guide, since I'm so confused about anything UEFI-related.

(BTW I did have the latest version of efibootmgr, since it's not included in the 2013.09.01 installation media).

Offline

#8 2013-09-22 21:02:53

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

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

You used arch-chroot and not just chroot, right?

Was /sys/firmware/efi/efivars populated in the chroot? If so, the latest version of efibootmgr should have worked fine.


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

#9 2013-09-22 21:12:54

vrg
Member
Registered: 2012-06-18
Posts: 36

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

Yes, arch-chroot. If I remember correctly, /sys/firmware/efi/efivars was not populated inside the chroot. In fact the folder didn't even exist. In any case, configuring the boot loader outside of the chroot (and modprobing efivars) is what worked for me.

Offline

#10 2013-09-22 21:28:38

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

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

Huh. So the question will be: what determines whether the efivars filesystem gets mounted? Since you needed to modprobe outside the chroot to get it to work, I assume this was not mounted in the live environment and that's why it would be unavailable in the chroot. (You could still modprobe and then chroot to get it working there if you wanted but you have to modprobe first to be sure.)

So the wiki instructions are only going to work if that filesystem is available in the live environment and maybe it isn't, even with the latest media?


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

#11 2013-09-22 21:45:59

vrg
Member
Registered: 2012-06-18
Posts: 36

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

When entering the live environment, /sys/firmware/efi/efivars did exist and was properly populated. However, before being able to create an "Arch Linux" entry with efibootmgr, I had to modprobe efivars (efibootmgr would complain about this). Hopefully this makes sense.

Offline

#12 2013-09-22 22:27:14

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

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

Huh. Then it should have been available in the chroot... I think?

And I don't see how this can happen since you must have been using the latest version of efibootmgr which should not need the modprobe if /sys/firmware/efi/efivars is available...

But hopefully somebody who knows more about this will comment as I'm just confused at this point!


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

#13 2013-09-22 22:42:00

jayflo
Member
Registered: 2013-09-06
Posts: 33

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

I'm fairly certain that I installed Arch Linux twice in the month of september using the 9.01 installer.  At one time the pre-arch-chroot commands involving umounting the efivars, proceeded by the modprobe commands, were in the installation guide. 

Later in the month, using the same installer (as another has not been released) I went through the Beginners guide and noticed that these pre-arch-chroot commands were missing.  Thinking that they were not necessary, I attempted to complete the installation without them...and this failed.  I restarted the installation and at the necessary time searched for the commands (specifically for grub) and finished the installation as usual.

It was after this experience that I started the thread.  I can corroborate vrg in that

Yes, arch-chroot. If I remember correctly, /sys/firmware/efi/efivars was not populated inside the chroot. In fact the folder didn't even exist. In any case, configuring the boot loader outside of the chroot (and modprobing efivars) is what worked for me.

Being a total newb, I wasn't sure if I had done something wrong since the wiki is usually correct.  But the installation guide is suspect considering there is a statement telling you to run these commands (concerning the bootloader) pre-arch-chroot, but then no such commands are listed.

Perhaps until a decision is made, the umount/modprobe efivars commands can be replaced on the beginner's installation guide?  (just to help beginners from having to track down this information from the get-go)

Offline

#14 2013-09-22 23:17:31

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

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

Please see the guide and the talk page for changes. Note that the Beginners' Guide gets edited regularly and the section on booting with UEFI has something of a history of issues so it would be helpful if people kept an eye on it and/or contributed to the talk page since I can only report your experiences second hand.


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

#15 2013-09-22 23:46:37

jayflo
Member
Registered: 2013-09-06
Posts: 33

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

cfr wrote:

Please see the guide and the talk page for changes. Note that the Beginners' Guide gets edited regularly and the section on booting with UEFI has something of a history of issues so it would be helpful if people kept an eye on it and/or contributed to the talk page since I can only report your experiences second hand.

What is the talk page?  Also, should I mark as solved?

Offline

#16 2013-09-22 23:49:00

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

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

At the top of the wiki page, there are tabs. I'm translating but they say something like "Page" (the article itself) "Talk" (discussion of the page "Edit" "History" and so on.

Do you consider it solved? It's your thread!


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

#17 2013-09-23 00:00:31

jayflo
Member
Registered: 2013-09-06
Posts: 33

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

I hope this is not considered bumping...

So I am certainly satisfied (since the commands have been replaced in the wiki), but I'm not sure if this issue is solved since it's not clear whether we should actually have to perform those commands.  I will mark it as solved, but will end the thread noting that the necessity of these commands still needs to be determined.

Thanks for you help everyone!

Last edited by jayflo (2013-09-23 00:02:03)

Offline

#18 2013-09-23 00:03:13

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

Necrobumping is when you try to start up an old dead and crusty thread.  For example, someone is had graphics problems with their Intel HW in 2009… then I have similar symptoms (or something just totally different… but who cares!), so I decide to post there telling about my amazingly same issue, even though I have an Ivy Bridge with HD4000 and an entirely different graphics stack.

Offline

#19 2013-09-23 00:33:16

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

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

I think the query was about the non-necro variant.

Generally bumping involves posting directly following a previous post of your own (i.e. no intervening posts by others) for no good reason. I think you're fine, therefore, on both counts tongue.


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

#20 2013-09-23 00:50:26

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

Oh, you're right.  I could have sworn I saw a "necro" in there.  Apparently I need to have my eyes checked.

Offline

#21 2013-09-23 01:03:27

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

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

At least we thoroughly covered the query between us!


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

#22 2013-09-23 05:19:01

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

The reason efivarfs is not mounted inside the chroot is because arch-chroot does not --rbind mount /sys inside the chroot. arch-chroot currently simply mounts a 2nd instance of sysfs and procfs in side the chroot. Due to this all the sub-mounts of host's /sys and /proc and not available in the chroot's /sys and /proc . We (myself and tpowa) encountered this in archboot setup script https://projects.archlinux.org/archboot … ller/setup , which we fixed as follows:

# chroot_mount()
# prepares target system as a chroot
#
chroot_mount()
{
    [[ -e "${DESTDIR}/proc" ]] || mkdir -m 555 "${DESTDIR}/proc"
    [[ -e "${DESTDIR}/sys" ]] || mkdir -m 555 "${DESTDIR}/sys"
    [[ -e "${DESTDIR}/dev" ]] || mkdir -m 755 "${DESTDIR}/dev"
    mount --make-runbindable /sys/fs/cgroup
    mount --rbind "/proc" "${DESTDIR}/proc"
    mount --rbind "/sys" "${DESTDIR}/sys"
    mount --rbind "/dev" "${DESTDIR}/dev"
}

# chroot_umount()
# tears down chroot in target system
#
chroot_umount()
{
    umount -R "${DESTDIR}/proc"
    umount -R "${DESTDIR}/sys"
    umount -R "${DESTDIR}/dev"
    mount --make-rshared /sys/fs/cgroup
}

EDIT: I am also the guy who made the changes in Beginner's Guide. The changes are valid as per the current set of pkgs in [core]. The efivars kernel module (old sysfs-efivars interface) is completely disabled in current core/linux kernel (since linux-3.11.1-1 pkg) (due to the fact that core/efibootmgr now supports efivarfs and there is no need to enable sysfs-efivars support anymore). Of course I did not think about the current released iso while editing, the fact that it still has old kernel and old efibootmgr, and therefore the users need to follow the old set of commands. However I recommen the user use the latest efibootmgr, chroot's after --rbind'ing and uses efibootmgr with efivarfs inside the chroot. There are no issues in 3.10's efivarfs so that should not be an issue. I would consider arch-chroot not doing 'mount --rbind', a bug.

Last edited by the.ridikulus.rat (2013-09-29 19:40:57)

Offline

#23 2013-09-23 20:46:36

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

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

the.ridikulus.rat wrote:

EDIT: I am also the guy who made the changes in Beginner's Guide. The changes are valid as far as per the current set of pkgs in [core]. The efivars kernel module (old sysfs-efivars interface) is completely disabled in current core/linux kernel (since linux-3.11.1-1 pkg) (due to the fact that core/efibootmgr now supports efivarfs and there are no need to enable sysfs-efivars support anymore). Of course I did not think while editing that the current released iso still has old kernel and old efibootmgr, and therefore the users need to follow the old set of commands that have been removed from the guide as of now. However I prefer the user uses the latest efibootmgr, chroot's after --rbind'ing and uses efibootmgr with efivarfs inside the chroot. There are no issues in 3.10's efivarfs so that should not be an issue. I would consider arch-chroot not doing 'mount --rbind', a bug.

Do you want to edit the wiki, then? The instructions need to work with the currently available .iso and the current version of arch-chroot. So the instructions I replaced are one way to do that. If you think it better to tell users to --rbind etc., then perhaps you could amend them appropriately. I don't feel comfortable doing that myself because I haven't tried that and am not sufficiently certain I understand all the necessary steps.

Have you filed a bug against arch-chroot?


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

#24 2013-09-23 21:05:10

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

cfr wrote:
the.ridikulus.rat wrote:

EDIT: I am also the guy who made the changes in Beginner's Guide. The changes are valid as far as per the current set of pkgs in [core]. The efivars kernel module (old sysfs-efivars interface) is completely disabled in current core/linux kernel (since linux-3.11.1-1 pkg) (due to the fact that core/efibootmgr now supports efivarfs and there are no need to enable sysfs-efivars support anymore). Of course I did not think while editing that the current released iso still has old kernel and old efibootmgr, and therefore the users need to follow the old set of commands that have been removed from the guide as of now. However I prefer the user uses the latest efibootmgr, chroot's after --rbind'ing and uses efibootmgr with efivarfs inside the chroot. There are no issues in 3.10's efivarfs so that should not be an issue. I would consider arch-chroot not doing 'mount --rbind', a bug.

Do you want to edit the wiki, then? The instructions need to work with the currently available .iso and the current version of arch-chroot. So the instructions I replaced are one way to do that. If you think it better to tell users to --rbind etc., then perhaps you could amend them appropriately. I don't feel comfortable doing that myself because I haven't tried that and am not sufficiently certain I understand all the necessary steps.

Have you filed a bug against arch-chroot?

I have edited the page now. I removed direct efistub booting as it still does not work properly in some systems and is definitely not recommended for beginners to tinker with. I also made important changes to gummiboot steps since you reverted back to wrong set of commands. I also explained briefly about PARTUUID being used in the config file. See https://wiki.archlinux.org/index.php?ti … did=276390 for my changes.

Offline

#25 2013-09-24 00:32:28

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

Re: [Solved] Beginner's Guide UEFI bootloader mixup?

the.ridikulus.rat wrote:

I have edited the page now. I removed direct efistub booting as it still does not work properly in some systems and is definitely not recommended for beginners to tinker with. I also made important changes to gummiboot steps since you reverted back to wrong set of commands.

Actually, that wasn't me. I didn't touch those commands as I don't know anything about using gummiboot. All I did was put the pre-chroot notes back on the grounds that users reported them to work whereas the instructions which were there were failing. (You can confirm this was not me in this history if you wish - i double-checked for my own peace of mind.)

I also explained briefly about PARTUUID being used in the config file. See https://wiki.archlinux.org/index.php?ti … did=276390 for my changes.

You should probably put a note on the talk page about the changes you've made.


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