You are not logged in.

#1 2017-10-09 01:58:14

heshakomeu
Member
Registered: 2017-09-14
Posts: 16

[SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

Hey there,

So I recently put together a computer and decided to put Arch on it. It's a Ryzen system, with an AB350m-Pro4 motherboard, a Ryzen 5 1600x, and a 250gb SSD. However, I'm still pretty new to Linux - only started learning this summer - and I'm even newer to Arch. While I've gotten Arch running pretty well on an old Dell Vostro, that was a BIOS system, and now I'm trying to put it on a system that uses UEFI.

I adjusted to the necessity of a ESP partition and made a 512MB one alongside an 8 gb swap partition and the remaining 220ish gb were my main Linux file system. I didn't bother with making a separate /home partition. I formatted everything, including the ESP. I did this using cfdisk; I should note that there wasn't any visible bootable flag I could toggle on any of the partitions, which I remember being present when installing this on my old laptop.

I ran into a wall when it came to installing a bootloader. I loved the customizability of rEFInd, so I went to the wiki to figure out how to install it. Seemed pretty straightforward; I went back and mounted my ESP partition to /boot, as I hadn't yet done that, and went to install rEFInd. Installed fine, no errors. I then rebooted the system and removed my bootable USB, excited to start configuring the system.

But when the machine booted up, rEFInd did not detect my Arch install. I plugged in my bootable USB drive again and went to work trouble-shooting. I tried the manual installation of rEFInd, fiddled around in the /refind_linux.conf., but ultimately got too drained from it. I should note here that there were a couple things from the wiki that I did not do because I did not understand how to: under the Manual Install section of the rEFInd wiki page (https://wiki.archlinux.org/index.php/RE … stallation) I am told to install all of rEFInd's drivers with the commands:

# mkdir esp/EFI/refind/drivers_x64
# cp /usr/share/refind/drivers_x64/drivername_x64.efi esp/EFI/refind/drivers_x64/

What is drivername supposed to be here? Nothing on the wiki page explains what its supposed to be.

I also could not figure out how to tweak rEFInd's settings and configure it. The wiki says as follows:

If you are still unable to boot or if you want to tweak rEFInd's settings, many options can be changed with a config file:

# cp /usr/share/refind/refind.conf-sample esp/EFI/refind/refind.conf

The sample config is well commented and self-explanatory.

Copying this into my terminal does nothing. What commands am I supposed to input in order to actually change options here? Genuinely wondering. It wasn't particularly self-explanatory to me.

Anyways, so I decided to let go of that dream and figured I could get that working later. The last Arch install I did, I used grub-bios, so I decided to try grub (not grub-bios) for this install. Download went fine, but when I attempted to install it, I was greeting with "ESP partition not found!" No amount of reconfiguration I could do could convince grub that no, I did indeed have an ESP partition.

I'm sure I'm doing something pathetically amateur here, I just don't know what. The ideal end-goal is having rEFInd as my boot manager utilizing EFISTUB to actually boot up Arch, but I'll take any working bootloader. Any help would be appreciated. Thanks!

Last edited by heshakomeu (2017-10-09 15:36:23)

Offline

#2 2017-10-09 02:19:39

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

Re: [SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

heshakomeu wrote:

Hey there,
I formatted everything, including the ESP. I did this using cfdisk; I should note that there wasn't any visible bootable flag I could toggle on any of the partitions, which I remember being present when installing this on my old laptop.

No boot flag is normal for an ESP. Please provide the listing of your partition table. With gdisk, I'd use

gdisk -l /dev/sdX

Also, the output of

blkid

I ran into a wall when it came to installing a bootloader. I loved the customizability of rEFInd, so I went to the wiki to figure out how to install it. Seemed pretty straightforward; I went back and mounted my ESP partition to /boot, as I hadn't yet done that, and went to install rEFInd. Installed fine, no errors. I then rebooted the system and removed my bootable USB, excited to start configuring the system.

How did you configure it? What did you do exactly?

If the ESP was not mounted when you did the initial installation of Linux, the kernel and initrd will not be on the ESP. Check if these files were installed to your ESP or if your main partition has them. In the latter case, you can manually copy the files to the ESP by mounting the ESP somewhere else. Or you can reinstall the kernel.

But when the machine booted up, rEFInd did not detect my Arch install. I plugged in my bootable USB drive again and went to work trouble-shooting. I tried the manual installation of rEFInd, fiddled around in the /refind_linux.conf., but ultimately got too drained from it. I should note here that there were a couple things from the wiki that I did not do because I did not understand how to: under the Manual Install section of the rEFInd wiki page (https://wiki.archlinux.org/index.php/RE … stallation) I am told to install all of rEFInd's drivers with the commands:

So you got the refind boot manager, but it did not include an entry for Arch? This sounds like the boot manager is installed, but the image and loader are not on the ESP, as I suggested above.

# mkdir esp/EFI/refind/drivers_x64
# cp /usr/share/refind/drivers_x64/drivername_x64.efi esp/EFI/refind/drivers_x64/

What is drivername supposed to be here? Nothing on the wiki page explains what its supposed to be.

Whichever drivers you need. If you mount the ESP at /boot, you don't need to worry about this unless you need refind to pick up other OSs with boot loaders on other file systems.

I also could not figure out how to tweak rEFInd's settings and configure it. The wiki says as follows:

If you are still unable to boot or if you want to tweak rEFInd's settings, many options can be changed with a config file:

# cp /usr/share/refind/refind.conf-sample esp/EFI/refind/refind.conf

The sample config is well commented and self-explanatory.

Copying this into my terminal does nothing. What commands am I supposed to input in order to actually change options here? Genuinely wondering. It wasn't particularly self-explanatory to me.

It is just a text file. Edit it the way you edited all the other configuration files during installation wink.

Anyways, so I decided to let go of that dream and figured I could get that working later. The last Arch install I did, I used grub-bios, so I decided to try grub (not grub-bios) for this install. Download went fine, but when I attempted to install it, I was greeting with "ESP partition not found!" No amount of reconfiguration I could do could convince grub that no, I did indeed have an ESP partition.

What command did you use? What was the exact output?

Note that some firmware will not work with the stub loader. There is no reason to think this is true of yours, but it can happen.

A 550MB ESP is recommended as a minimum. Many machines will boot with smaller ESPs, but some won't. (Or won't unless you do strange things like format them 'wrongly'.)


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 2017-10-09 02:36:45

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

It could also be that you never set the right type on the EFI partition.  If you use gdisk, the EFI partition should have an EF00 type.  And make sure it is formatted to FAT32, which I'm sure it already is or you would have even more errors.

Edit: nevermind, see below.  I'm wrong.

Last edited by circleface (2017-10-09 02:50:19)

Offline

#4 2017-10-09 02:41:16

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

Re: [SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

circleface wrote:

It could also be that you never set the right type on the EFI partition.  If you use gdisk, the EFI partition should have an EF00 type.  And make sure it is formatted to FAT32, which I'm sure it already is or you would have even more errors.

Note that the boot manager works - and refind wouldn't work without a valid ESP. It is the boot loader for Arch where the trouble starts.


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 2017-10-09 02:49:21

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

Ahh, I  have never used refind, so thanks for the correction.

Offline

#6 2017-10-09 04:50:32

heshakomeu
Member
Registered: 2017-09-14
Posts: 16

Re: [SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

Thank you so much for the replies! Because I could not remember all the exact steps I took, I decided to just do a clean reinstall of the entire system and document each step I took, ending with trying to install rEFInd as my boot manager again. I was going to go by the book with every single step, and strictly follow what the wiki said to the best of my abilities. It worked as well as the first time, but now I gots receipts.

I started with making partitions in gdisk. I was very careful to format each of them afterwards. I made three partitions again, this time in gdisk (last time I used cfdisk because it felt more convenient) in the following order:

/dev/sda1 - 8gb, swap
/dev/sda2 - 550mb, EFI System
/dev/sda3 - Linux file system

I then ran the following commands:

# mkfs.fat -F32 /dev/sda2
# mkfs.ext4 /dev/sda3
# mkswap /dev/sda1
# swapon /dev/sda1
# mount /dev/sda3 /mnt
# mount /dev/sda2 /boot

I did them in that order, too, if that matters. The EFI System Partition wiki page was very specific about mounting /boot to my EFI partition in a UEFI system.

cfr wrote:

No boot flag is normal for an ESP. Please provide the listing of your partition table. With gdisk, I'd use

gdisk -l /dev/sdX

Also, the output of

blkid

I'm relived to learn that UEFI does not have bootable flags! I got worried I had done something wrong with making the bootable USB or something. Anyways,

gdisk -l /dev/sda

returns:

Number:  Start              End             Size         Code   Name
1             2048             16779263    8.0GB      8200   Linux swap
2             16779264     17905663    550MB     EF00   EFI System
3             17905664    488395021   224.3GB  8300   Linux filesystem
blkid

returns a list of 5 rows. I hope you're okay with me leaving out the UUIDs; I tried to type them out but random strings of characters are a bit of a pain.

/dev/sda1: TYPE="swap" PARTLABEL="Linux swap"
/dev/sda2: TYPE="vfat" PARTLABEL="EFI System"
/dev/sda3: TYPE="ext4" PARTLABEL="Linux filesystem"
/dev/sdb1: LABEL ="ARCH_201709" TYPE="vfat"
/dev/loop0: TYPE="squashfs"

I then went on to install the kernel:

# pacstrap /mnt base base-devel

Then followed this with generating fstab and checking to see what resulted:

# genfstab -U /mnt >> /mnt/etc/fstab
# cat /mnt/etc/fstab
     /dev/sda3     /           ext4     rw,relatime,data=ordered       0  1
     /dev/sda1    none     swap   defaults                                   0  0

I immediately notice /dev/sda2, my EFI partition, is not listed. Is that normal?

Then I chrooted into /mnt. Setting my time zone brought up no problems.

I went on to edit /etc/locale.gen using nano, which I did successfully, and followed that with locale-gen to successfully generate the locale. But here is where my problems start arising, and why I didn't know how to edit

esp/EFI/refind/refind.conf

. When I went to set the

LANG

variable,

nano /etc/locale.conf

only brought up a blank page. Trying to bypass that with

localectl set-locale LANG=en_US.UTF-8

returns:

Failed to create bus connection: No such file or directory

All right, whatever, the defaults are English anyways so I was sure it'd be fine to move on. I went to add a hostname, but

nano /etc/hostname

also brought up a blank page. I then ran

cat /etc/hostname

to try to find it at all, and it returned:

cat: /etc/hostname: No such file or directory

hostnamectl returns:

Failed to create bus connection: No such file or directory

However,

echo marti > /etc/hostname

worked fine. I followed that with

nano /etc/hosts

and successfully added the new hostname to the list.

All right. Now for the star of the show, rEFInd. I ran

pacman -S refind-efi

and successfully downloaded it, but it included a curious tip in the midst of the downloading files:

Copy the efi application (according to your UEFI ARCH) and /usr/share/refind/refind.conf-sample to a sub-drectory of <EFISYS>/EFI/ as refind.conf and add an entry to firmware boot menu using efibootmgr or mactel-boot (for Macs).

Whatever, I'll try that in a second, but I'm trying to follow the wiki's page on rEFInd for this part as much as possible. I run

refind-install

and that returns:

ShimSource is none
Installing rEFInd on Linux....
The ESP doesn't seem to be mounted! Trying to find it...
// doesn't seem to be on a VFAT filesystem. The ESP must be mounted at //boot or //boot/efi and it must be VFAT! Aborting!

Okay, this can happen. The wiki acknowledges that. I managed to get it to work last time by fiddling around with a lot of files and generating some stuff but for the life of me I cannot remember what I did. So I go to the Manual Installation section and start at the top. I run

cp /usr/share/refind/refind_x64.efi /boot/EFI/refind/

(I use /boot here because /dev/sda2 is mounted to /boot) only to get:

cp: cannot create regular file '/boot/EFI/refind/': No such file or directory

At that point, I decided to bring my findings here again. Thanks again for the recommendations; I hope this provides any (or all) of the missing information I left out in my original posting.

Last edited by heshakomeu (2017-10-09 04:53:00)

Offline

#7 2017-10-09 04:53:49

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

heshakomeu wrote:
# mount /dev/sda2 /boot

That sets off an alarm if that's not a typo. It needs to be /boot of the *new* system, which would be /mnt/boot at that point.

Offline

#8 2017-10-09 04:58:44

heshakomeu
Member
Registered: 2017-09-14
Posts: 16

Re: [SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

Scimmia wrote:
heshakomeu wrote:
# mount /dev/sda2 /boot

That sets off an alarm if that's not a typo. It needs to be /boot of the *new* system, which would be /mnt/boot at that point.

It was not a typo. Shoot. That's likely my problem here. I was following the EFI System Partition wiki page (https://wiki.archlinux.org/index.php/EF … _partition) word-for-word:

In case of EFISTUB, the kernels and initramfs files should be stored in the EFI System Partition. For sake of simplicity, you can also use the ESP as the /boot partition itself instead of a separate /boot partition, for EFISTUB booting. In other words, after creating and formatting the EFI System Partition as instructed above, simply mount it at /boot.

I had originally done mkdir /mnt/boot and then mount /dev/sda2 /mnt/boot , but I decided to err on the side of caution and stick with what the wiki explicitly says, so I did umount /dev/sda2 and then mount /dev/sda2 /boot . Did the wiki lead me astray?

Last edited by heshakomeu (2017-10-09 04:59:31)

Offline

#9 2017-10-09 06:04:38

heshakomeu
Member
Registered: 2017-09-14
Posts: 16

Re: [SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

Incorrectly mounting /dev/sda2 to /boot instead of /mnt/boot/ was not the problem - or, at least, not the problem that stops both grub and rEFInd from finding the EFI directory. I repeated the exact steps above twice, mounting /dev/sda2 to /mnt/boot and /boot/efi . Neither produced a different result.

Offline

#10 2017-10-09 06:13:03

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

If you got the same message, you didn't mount the ESP to the right place.

You should also look up how to create and edit text files in LInux. You keep saying "brought up a blank page", which tells me that you're lost on this point.

Offline

#11 2017-10-09 06:31:54

heshakomeu
Member
Registered: 2017-09-14
Posts: 16

Re: [SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

Scimmia wrote:

If you got the same message, you didn't mount the ESP to the right place.

That's likely true, but where do I mount it? The wiki's instructions were either exceptionally misleading or wrong. If neither /boot, nor /mnt/boot, nor /boot/efi work, then what mount point should I use?

Scimmia wrote:

You should also look up how to create and edit text files in LInux. You keep saying "brought up a blank page", which tells me that you're lost on this point.

I think only because I expected there to already be something in the text files. The installation guide of the wiki does not phrase the commands as though I am creating a document; it phrases it as though said text file is supposed to already be there. Now, this is likely because I'm a complete noob when it comes to Linux, but if a beginner can't understand the Installation Guide on the wiki, then that is a bit of a problem.

Here is an example, from the Installation Guide:

Uncomment en_US.UTF-8 UTF-8 and other needed localizations in /etc/locale.gen, and generate them with:

# locale-gen

Set the LANG variable in locale.conf(5) accordingly, for example:

/etc/locale.conf
LANG=en_US.UTF-8

/etc/locale.gen was a text document already generated during the installation process. The phrasing of this section of the wiki would make me think that I would be setting the LANG variable as I set my language: by uncommenting LANG=en_US.UTF, or something of the sort. However, opening up the file does not reveal a similar layout as /etc/locale.gen. There is nothing. I am being told by the wiki to edit a file that does not yet exist.

I didn't mention it in my last comment, but the one thing I did differently was edit those files by writing what the guide said to edit in, then saving them. With this part, for example, I wrote LANG=en_US.UTF-8 in the blank document and saved it. I have no idea if this is what I was supposed to do, and I have no idea if it changed anything.

Last edited by heshakomeu (2017-10-09 06:32:34)

Offline

#12 2017-10-09 08:55:39

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

Re: [SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

mount /dev/sdX /mnt
mkdir -p /mnt/boot
mount /dev/sdY /mnt/boot

where X specifies your ext4 partition and Y specifies the EFI partition. You surely got an error if you tried to mount the EFI partition without creating the mount point first.

In general, pay attention to the output you get from the commands - don't just type them blindly. If you get errors, you need to address them before moving on.

The wiki pages on boot loader installation are written both for initial installation and for later changes to the system. But you should be chrooted at the point when you install the boot loader, with everything already mounted. At this point, /boot should point to your ESP because arch-chroot switches you into your new system.


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 2017-10-09 15:35:44

heshakomeu
Member
Registered: 2017-09-14
Posts: 16

Re: [SOLVED] Struggling to boot up Arch with UEFI through rEFInd or Grub

cfr wrote:
mount /dev/sdX /mnt
mkdir -p /mnt/boot
mount /dev/sdY /mnt/boot

where X specifies your ext4 partition and Y specifies the EFI partition. You surely got an error if you tried to mount the EFI partition without creating the mount point first.

In general, pay attention to the output you get from the commands - don't just type them blindly. If you get errors, you need to address them before moving on.

The wiki pages on boot loader installation are written both for initial installation and for later changes to the system. But you should be chrooted at the point when you install the boot loader, with everything already mounted. At this point, /boot should point to your ESP because arch-chroot switches you into your new system.

So I'm not entirely sure what I did differently from the last time I tried mounting /dev/sda2 to /mnt/boot , but I did another reinstall while doing as you recommend here and everything worked fine. blkid outputted a third partition on /dev/sda , and rEFInd installed no problem! I'm now just trying to configure refind_linux.conf so it boots from the system.

I am a sheep by nature, my friend, but I will try to not bulldoze through errors without pausing anymore.

Thank you all for your help! I'd consider this solved.

Offline

Board footer

Powered by FluxBB