You are not logged in.

#1 2013-05-28 07:37:06

totolotto
Member
From: Hungary
Registered: 2012-11-13
Posts: 114

[SOLVED] UEFI installation - booting failure

Hi All,

Setting in BIOS: UEFI boot mode, Secure Boot Off

Booting from USB in UEFI mode, everything is OK. Then I did this:

gdisk /dev/sda
create new GPT partition

cgdisk /dev/sda
Part. #     Size        Partition Type            Partition Name
----------------------------------------------------------------
            1007.0 KiB  free space
   1        512 Mb       EFI system	              efi
   2        6 GiB        Linux filesystem	      root
   3        122 GiB      Linux filesystem	      home

mkfs.vfat -F32 -n efi /dev/sda1
mkfs.ext4 /dev/sda2
mkfs.ext4 /dev/sda3

mkdir -p /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi
mount /dev/sda2 /mnt
mkdir -p /mnt/home
mount /dev/sda3 /mnt/home
 ...

Then I followed the installation guide. At the "Install a bootloader" section I tried both EFISTUB and GRUB:.

At Point 5 here https://wiki.archlinux.org/index.php/Beginners'_Guide#EFISTUB I created refind_linux.conf with sdax = sda2

# nano /boot/efi/EFI/arch/refind_linux.conf
"Boot to X"          "root=/dev/sda2 ro rootfstype=ext4 systemd.unit=graphical.target"
"Boot to console"    "root=/dev/sda2 ro rootfstype=ext4 systemd.unit=multi-user.target"

and at Point 6 X=a, Y=1:

# efibootmgr -c -d /dev/sda -p 1 -w -L "rEFInd" -l '\EFI\refind\refind_x64.efi'

GRUB is quite straightforward.

After restart I got "no bootable device" error. The strange thing is that in BIOS I can see and select "rEFInd" or "arch_grub" in booting options, but anyhow it just won't boot.

Thank you for your help.

Last edited by totolotto (2013-06-22 17:33:39)

Offline

#2 2013-05-30 02:27:11

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

Re: [SOLVED] UEFI installation - booting failure

mount root to /mnt *before* you mount the EFI partition to /mnt/boot/efi i.e. mount root, then mkdir -p /mnt/boot/efi, then mount the EFI partition.


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-06-21 18:40:56

totolotto
Member
From: Hungary
Registered: 2012-11-13
Posts: 114

Re: [SOLVED] UEFI installation - booting failure

Thanks, the mounting order was not correct indeed. Now I can boot and get to the rEFInd menu, but I cannot access tty.

If I select "Boot EFI\arch\vmlinuz.efi from 246 MiB FAT volume":

ERROR: device '' not found. Skipping fsck.
ERROR: Unable to find root device ''.
You are being dropped to recovery shell.

In case of "Boot boot\vmlinuz-linux from 6 GiB ext4 volume"

ERROR: device 'PARTUUID=xxxxx' not found. Skipping fsck.
ERROR: Unable to find root device 'PARTUUID=xxxxxx'.
You are being dropped to recovery shell.

xxxxxx = PARTUUID of my root partition.

What can be the problem?

Offline

#4 2013-06-21 18:53:45

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

Re: [SOLVED] UEFI installation - booting failure

@totolotto: Make sure you have the latest util-linux pkg installed and rebuild your initramfs.

Offline

#5 2013-06-21 19:10:24

totolotto
Member
From: Hungary
Registered: 2012-11-13
Posts: 114

Re: [SOLVED] UEFI installation - booting failure

Well I must have becasue I just made a clean install...

Offline

#6 2013-06-21 21:02:44

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

Re: [SOLVED] UEFI installation - booting failure

Is there some particular reason you are using /dev/sda2 in refind_linux.conf rather than specifying the partuuid as in the sample config file?

util-linux may be up to date but have you regenerated your initramfs with everything mounted correctly?


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-06-21 21:08:23

totolotto
Member
From: Hungary
Registered: 2012-11-13
Posts: 114

Re: [SOLVED] UEFI installation - booting failure

cfr wrote:

Is there some particular reason you are using /dev/sda2 in refind_linux.conf rather than specifying the partuuid as in the sample config file?

util-linux may be up to date but have you regenerated your initramfs with everything mounted correctly?

Sorry I forgot to mention that I changed that too, now the config file looks like this:

	"Boot with defaults" "root=PARTUUID=XXX ro rootfstype=ext4 add_efi_memmap 	systemd.unit=graphical.target"

	"Boot to Terminal"   "root=PARTUUID=XXX ro rootfstype=ext4 add_efi_memmap 	systemd.unit=multi-user.target

XXX = PARTUUID of my root partition

Offline

#8 2013-06-21 23:20:09

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

Re: [SOLVED] UEFI installation - booting failure

OK. Let's step back a bit. I just reread your original post and noticed that you mention GRUB as well as rEFInd. Now, there are reasons to install both - I use both myself - but I am wondering why you decided to start this way.

EDIT: I think you need to specify the initrd in refind_linux.conf.

EDIT EDIT: See https://bbs.archlinux.org/viewtopic.php … 7#p1290757.

Last edited by cfr (2013-06-22 00:14:41)


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-06-22 00:37:33

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

Re: [SOLVED] UEFI installation - booting failure

cfr wrote:

EDIT: I think you need to specify the initrd in refind_linux.conf.

I fear that you have made this statement because of my misunderstanding in the linked thread.  So I would like to mention here that I looked this up in the rEFInd docs, and it does indeed serach for the initamfs automagically.  See the linked thread for what I found.

Offline

#10 2013-06-22 00:50:22

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

Re: [SOLVED] UEFI installation - booting failure

WonderWoofy wrote:
cfr wrote:

EDIT: I think you need to specify the initrd in refind_linux.conf.

I fear that you have made this statement because of my misunderstanding in the linked thread.  So I would like to mention here that I looked this up in the rEFInd docs, and it does indeed serach for the initamfs automagically.  See the linked thread for what I found.

Thanks, WonderWoofy. Yes, that was my reason for saying that.

OP,
Can you post the contents of fstab?


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-06-22 01:23:07

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

Re: [SOLVED] UEFI installation - booting failure

Some comments/suggestions:

  • In rEFInd, highlight the Arch kernel you want to boot and hit F2 or Insert twice. This will open a line editor that shows the boot options it will be passed. Verify that they're correct (that is, that they're what you entered in refind_linux.conf, perhaps plus an "initrd=" entry, if that's not in there). If not, perhaps refind_linux.conf isn't being read for some reason (EFI FAT driver bug, file not where it should be, etc.).

  • Verify that the initrd is where it should be and that it's being found by rEFInd (or specified correctly in refind_linux.conf).

  • You could try playing with the "root=" option. For testing, I find that the device filename ("/dev/sda2" or whatever) is the easiest and most reliable way to go; but using a UUID= or PARTUUID= specification is usually more reliable in the long run. I've heard of cases where one or another of these doesn't work for idiosyncratic reasons.

  • If you can't get it working, post the output of "gdisk -l /dev/sda", of "parted /dev/sda print", and of "ls -l /boot" (or wherever your /boot directory ends up being when you boot whatever system you're using for testing and recovery).

Offline

#12 2013-06-22 11:04:18

totolotto
Member
From: Hungary
Registered: 2012-11-13
Posts: 114

Re: [SOLVED] UEFI installation - booting failure

Ok I think I am getting there, now I can boot with the second option "Boot boot\vmlinuz-linux from 6 GiB ext4 volume", but the first option still does not work:

Boot EFI\arch\vmlinuz-arch.efi from 512Mib FAT volume
...
ERROR: device '' not found. Skipping fsck.
ERROR: Unable to find root device ''.

The rEFInd line editor shows this:

initrd=EFI\arch\initramfs-arch.img

Efibootmgr fails to create a boot enrtry so I have to add manually it in UEFI Shell:

bcfg boot add 6 fs1:\EFI\refind\refind_x64.efi "rEFInd"

Maybe this manual addition have something to do with the error above? Any idea?

Also, how can I add a boot entry in UEFI Shell that will boot into Arch directly? (since efibootmgr not an option for me)

Offline

#13 2013-06-22 13:05:50

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

Re: [SOLVED] UEFI installation - booting failure

Is the second option that works the fallback initramfs?  If so, it probably means that you are having issues with your main initramfs and not with refind now.  The fallback initramfs does not use the autodetect hook, so it loads modules (drivers) for all kinds of hardware... basically everything it can find. The regular initramfs finds all the modules required to boot your computer and loads those.

So I think what you need to do is boot into the installation, and then regenerate the initramfs' with mkinicpio... or just update because there was a kernel update and this will be regernated for you.

Offline

#14 2013-06-22 13:43:46

totolotto
Member
From: Hungary
Registered: 2012-11-13
Posts: 114

Re: [SOLVED] UEFI installation - booting failure

rEFInd boot manager shows 2 Arch logos:
1) Boot EFI\arch\vmlinuz.efi from 512 MiB FAT volume
2) Boot boot\vmlinuz-linux from 6 GiB ext4 volume

The config file for 2)

root=PARTUUID=..... initrd=boot\initramfs-linux.img

This one is working, the first option with initrd=EFI\arch\initramfs-arch.img does not.

I ran mkinitcpio again, still not good. But I am thinking and trying to find out the meaning of the error message: unable to fin root device ''.
Is there another configuraiton for initramfs-arch.img? I guess it should work If this used the same refind_linux.conf file.

Last edited by totolotto (2013-06-22 13:46:34)

Offline

#15 2013-06-22 17:31:49

totolotto
Member
From: Hungary
Registered: 2012-11-13
Posts: 114

Re: [SOLVED] UEFI installation - booting failure

totolotto wrote:

rEFInd boot manager shows 2 Arch logos:
1) Boot EFI\arch\vmlinuz.efi from 512 MiB FAT volume
2) Boot boot\vmlinuz-linux from 6 GiB ext4 volume

The config file for 2)

root=PARTUUID=..... initrd=boot\initramfs-linux.img

This one is working, the first option with initrd=EFI\arch\initramfs-arch.img does not.

I ran mkinitcpio again, still not good. But I am thinking and trying to find out the meaning of the error message: unable to fin root device ''.
Is there another configuraiton for initramfs-arch.img? I guess it should work If this used the same refind_linux.conf file.


Ok, I got it. I just had to copy the refind_linux.conf file to /boot/efi/EFI/arch/

Thanks for your help, I mark it as solved because I can boot in UEFI mode now, but I am still looking for the solution to boot into Arch directly without using efibootmgr.

Offline

#16 2013-06-22 18:27:24

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

Re: [SOLVED] UEFI installation - booting failure

Where is the initramfs-arch.img coming from?  This is what the initramfs on the archiso is called, so I'm not sure where it is picking that up from.

What do you mean exactly when you say you are looking for "the solution to boot into Arch directly without using efibootmgr"?  Efibootmgr is simply a utility that is used to create boot entries in the firmware's boot manager.  Though it is possible to create a direct efibootmgr entry, it is not particularly the best solution.  This is because a boot manager (like rEFInd and gummiboot) allow you to use the kernel's efistub loader, but still have the ability to change the kernel command line before booting.  Also it takes but a few milliseconds to load the boot manager before it hands off control to the kernel itself.  I think a better option would be to give rEFInd a timeout of zero.  I believe there is a key (or keys?) that you can hold down to have the menu show up when the timeout is set to zero.  This is how gummiboot works anyway, I have it set to zero (actually I just omit the timeout line altogether) and when I want to actually see the menu, I hold down the spacebar.

If you are still set on creating a direct efibootmgr entry, I have heard that some versions of efibootmgr with some version of kernels will not produce an efibootmgr entry, so downgrading is required to do so.  This being the case, you might try either booting from a live cd of another distribution with a lower kernel and efibootmgr version (in UEFI mode of course), or if you have an older archiso image, you could do it from there as well.

Offline

#17 2013-06-22 19:47:22

totolotto
Member
From: Hungary
Registered: 2012-11-13
Posts: 114

Re: [SOLVED] UEFI installation - booting failure

initramfs-arch.img is coming from the Beginners' Guide Point 2. Or did I overcomplicate this? To be hones I do not know why I have these 2 options in the booting manager (but obviously I am not an expert).

With regard to "boot into Arch directly" I understand that it is possilbe with efibootmgr described here, however efrbootmgr does not work for me. But your point is taken, we are taliking about milliseconds here. I'm just curious how to do it without efibootmgr (from UEFI Shell for example?)

Offline

#18 2013-06-22 21:18:40

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

Re: [SOLVED] UEFI installation - booting failure

Well if you can use the version 2 uefi shell you have bcfg and I assume you can because you mention using bcfg to create an entry earlier. If so, you can create an entry to directly boot the kernel if you wish.


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

#19 2013-06-22 22:04:19

totolotto
Member
From: Hungary
Registered: 2012-11-13
Posts: 114

Re: [SOLVED] UEFI installation - booting failure

cfr wrote:

Well if you can use the version 2 uefi shell you have bcfg and I assume you can because you mention using bcfg to create an entry earlier. If so, you can create an entry to directly boot the kernel if you wish.

True I have v2 UEFI and used bcfg and even used the shell to boot into arch directly:

vmlinuz-arch.efi root=PARTUUID=XXXX ro rootfstype=ext4 add_efi_memmap initrd=EFI/arch/initramfs-arch.img

But this is manual work. I could not find out is how to "export" the parameters (root partuuid etc.) into a boot entry with bcfg. Archwiki explains how to put this command line into a script file, but no reference on how to write this into the boot entry.

Offline

#20 2013-06-22 22:21:53

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

Re: [SOLVED] UEFI installation - booting failure

Why not try the help as explained at https://wiki.archlinux.org/index.php/Un … rface#bcfg?

You will have to do this for yourself unless somebody else offers instructions. I have UEFI firmware prior to 2.3 and cannot use the later version of the shell. (Actually, I've never gotten any version of the shell to work.)


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

#21 2013-06-22 23:05:19

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

Re: [SOLVED] UEFI installation - booting failure

I think the problem with bcfg is that I don't think you can pass kernel command line arguments to it.  Though I have honestly never actually tried this (efibootmgr has always worked for me).  This is why I went through the trouble of telling you to try using a livecd of another distribution (where the kernel and efibootmgr versions will be lower) or try using an older live image of archiso.  There is a thread by karitech around here somewhere describing issues with efibootmgr.  In those cases, it seemed that downgrading the kernel and efibootmgr were always a viable workaround.

Offline

#22 2013-06-23 02:18:52

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

Re: [SOLVED] UEFI installation - booting failure

totolotto wrote:

rEFInd boot manager shows 2 Arch logos:
1) Boot EFI\arch\vmlinuz.efi from 512 MiB FAT volume
2) Boot boot\vmlinuz-linux from 6 GiB ext4 volume

This means that you've got your kernel (or possibly different kernels) stored on two partitions. The first looks like it's a kernel on your ESP, and the second looks like it's your root (/) Linux filesystem, accessed via the rEFInd ext4fs driver. To simplify your life, I recommend deleting the kernel from the ESP and using the kernel in your Linux /boot directory (that is, kernel #2). If you try to keep both of them, you'll have to copy new kernels from /boot to the ESP whenever you upgrade your kernel, and you'll end up with two entries in rEFInd that boot the same kernel, which is sort of pointless.

That said, if you don't want to use rEFInd in the long term, copying your kernels to the ESP, or reconfiguring your mount point so that the ESP is mounted at /boot and therefore your kernels get stored there automatically, can make sense. Given where you are, though, the quickest path to an efficient setup is to just ditch the kernels on the ESP and boot your kernels off of your root (/) partition's /boot directory.

totolotto wrote:

With regard to "boot into Arch directly" I understand that it is possilbe with efibootmgr described here, however efrbootmgr does not work for me

Some people do like to boot their kernels directly, without using rEFInd, gummiboot, GRUB, or anything else. Note that efibootmgr isn't involved in the boot process per se; it's just used to set up the firmware's boot manager. Thus, saying you want to "boot with efibootmgr" (or words to that effect) is confusing, even to experts -- because this makes no sense, it's not clear what you really want. This uncertainty has been cleared up in subsequent posts, but I want to point it out to help you (and perhaps others who read this) communicate more clearly in the future.

FWIW, I tend to agree with WonderWoofy on this score -- although it's possible to configure the firmware to boot the kernel directly, the down sides to this approach more than outweigh whatever small speed benefits you get from it. In your case, totolotto, given the problems you're having with efibootmgr, it may not be a practical alternative -- at least, not unless and until you can overcome those problems.

WonderWoofy wrote:

I think a better option would be to give rEFInd a timeout of zero.  I believe there is a key (or keys?) that you can hold down to have the menu show up when the timeout is set to zero.  This is how gummiboot works anyway,

rEFInd doesn't have a 0-timeout option. In rEFInd, setting the timeout to 0 disables the countdown timer, so it never times out. The closest you can get to a 0-timeout in rEFInd is setting it to 1 second. If you must have a true 0 timeout, use gummiboot. Unfortunately, that means you won't be able to read the kernel files from a Linux filesystem, but mounting the ESP at /boot can create something that works about as well. Doing this will require some significant reconfiguration from where totolotto is now, but it can be done if getting a 0-timeout configuration is important.

Offline

#23 2013-06-23 11:07:14

totolotto
Member
From: Hungary
Registered: 2012-11-13
Posts: 114

Re: [SOLVED] UEFI installation - booting failure

@srs5694: Thanks for the clarification, I have removed the kernel from ESP.

Offline

Board footer

Powered by FluxBB