You are not logged in.

#1 2023-09-19 06:01:39

Gnarlsnishi
Member
Registered: 2023-09-19
Posts: 2

Seeking help with rEFInd config for root on Btrfs subvolume

Hi Arch community,
I am trying to set up an Arch installation using rEFInd as my boot manager, with my root partition on a Btrfs subvolume.
rEFInd itself loads properly and I get the graphical boot menu, however once I select the Arch Linux boot option, I get the following error messages.

rEFInd - Booting OS

Starting vmlinuz-linux
Using load options 'root=PARTUUID=384fe8bb-f4aa-455d-a334-214f9fbef598 rw rootflags=subvol=root initrd=\root\boot\initramfs-linux.img'
Invalid loader file!
Error: Not Found while loading vmlinuz-linux

* Hit any key to continue *

I have followed the instructions in the Arch Wiki page on rEFInd, and also spent some time searching the forums.
https://wiki.archlinux.org/title/REFInd … me_support

The (non-commented) content of my /boot/efi/refind/refind.conf is as below...

timeout 20
use_nvram false
also_scan_dirs +,root/boot

menuentry "Arch Linux" {
	icon     /EFI/refind/icons/os_arch.png
	volume   "384fe8bb-f4aa-455d-a334-214f9fbef598"
	loader   /root/boot/vmlinuz-linux
	initrd   /root/boot/initramfs-linux.img
	options  "root=PARTUUID=384fe8bb-f4aa-455d-a334-214f9fbef598 rw rootflags=subvol=root"
}

... and my /boot/refind_linux.conf is here:

"Boot using standard options"	"root=PARTUUID=384fe8bb-f4aa-455d-a334-214f9fbef598 rw rootflags=subvol=/root initrd=/root\boot\initramfs-linux.img"

I have also played around with various combinations of slashes, backslashes, quotation marks, etc in both config files, but it's possible I may have made a simple syntax error somewhere.

Happy to provide any other info that may be relevant.
Any help troubleshooting would be greatly appreciated! smile

Offline

#2 2023-09-19 07:26:26

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,580

Re: Seeking help with rEFInd config for root on Btrfs subvolume

https://wiki.archlinux.org/title/btrfs
Check the wiki. Your rootflags seem incorrect. It should either be rootflags=subvol=/path/to/subvolume or rootflags=subvolid=objectid. Your rootflags=subvol=root is neither a path nor an objectid.
https://wiki.archlinux.org/title/REFInd
Also check the rEFInd wiki regarding specifing the initrd relative to your ESP. Your initrd=\root\boot\initramfs-linux.img' seems incorrect There is a 'Warning' in the wiki that explains it.

Offline

#3 2023-09-19 08:58:39

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Seeking help with rEFInd config for root on Btrfs subvolume

d_fajardo wrote:

Your rootflags seem incorrect. It should either be rootflags=subvol=/path/to/subvolume or rootflags=subvolid=objectid. Your rootflags=subvol=root is neither a path nor an objectid.

subvol=root should be taken relative to the top-level subvolume / and thus be identical to subvol=/root.

Also check the rEFInd wiki regarding specifing the initrd relative to your ESP. Your initrd=\root\boot\initramfs-linux.img' seems incorrect

It's correct if the /boot directory is on the /root subvol, but the error says (IIUC) that /root/boot/vmlinuz-linux (which would be in the same dir as the initrd) is "not found", so probably not.

Gnarlsnishi, can you shed some light on that? How are you mounting the ESP? Which partition(/subvol) is /boot really on? And I haven't used refind in years, but going by the wiki, you have the configuration for both the "auto detection" and "manual boot stanza"? Does that give duplicate entries or does the manual one suppress the auto-detected one? If the /root/boot/ path in the manual one is wrong, maybe auto detection would get it right? (It might then still have the wrong initrd in refind_linux.conf, but the error should change if it can at least find the kernel.)

Last edited by Raynman (2023-09-19 08:59:05)

Offline

#4 2023-09-20 02:06:36

Gnarlsnishi
Member
Registered: 2023-09-19
Posts: 2

Re: Seeking help with rEFInd config for root on Btrfs subvolume

Thanks for the replies, both.

I ended up starting over from scratch, and was successful in getting a bootable system the second time around.
Here's what I did:

- Instead of using /boot as the mountpoint for my ESP, I used /efi.
- Made /boot a directory within the root subvolume, rather than making it a separate partition.
- When auto-generating the rEFInd binaries and configs using the refind-install script, I passed the flags --alldrivers and --usedefault /dev/sda1. (This is necessary so that rEFInd installs to the ESP rather than to /boot.)
- I didn't realize that a UUID and a PARTUUID are not the same thing. I found the correct PARTUUID to use in /dev/disk/by-partuuid.

Non-critical issues that I still need to troubleshoot are as follows.

- rEFInd shows two entries for Arch Linux, one of which unsuccessfully attempts to load the kernel from /efi and therefore doesn't boot.
- iso files on USB/CD are not bootable from rEFInd, however they do show up in the graphical boot menu. isos can still be booted successfully from the system BIOS/UEFI boot menu.

Hopefully this may help someone else in the future!

Offline

#5 2023-09-20 13:19:48

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,580

Re: Seeking help with rEFInd config for root on Btrfs subvolume

rEFInd shows two entries for Arch Linux, one of which unsuccessfully attempts to load the kernel from /efi and therefore doesn't boot.

You have an extraneous entry in your NVRAM in your motherboard from your previous install. You can delete that using efibootmgr. Beware though efibootmgr sometimes don't work on certain motherboards in which case you have to use a UEFI shell.

iso files on USB/CD are not bootable from rEFInd, however they do show up in the graphical boot menu. isos can still be booted successfully from the system BIOS/UEFI boot menu.

ISO files won't be bootable from rEFInd because rEFInd only recognizes efi files (xxxx.efi). Your BIOS as you said will boot them.

Offline

Board footer

Powered by FluxBB