Skip to main content
Topic: [Q] Booting Artix installed on BtrFS by rEFInd (Read 597 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Q] Booting Artix installed on BtrFS by rEFInd

Anyway the rEFInd UEFI manager v0.14.0 doesn't show the Artix kernel icon at all somewhy with the below settings seeming to be nothing wrong
Code: [Select]
% cat boot/refind_linux.conf
"Artix" "root=UUID=362b39ad-6169-42bb-9c20-0e5fe5a2ac8e rw rootflags=subvol=Artix initrd=Artix\boot\initramfs-linux.img"
"Artix single user mode" "root=UUID=362b39ad-6169-42bb-9c20-0e5fe5a2ac8e rw rootflags=subvol=Artix initrd=Artix\boot\initramfs-linux.img single"
"Artix with AMD mu-codes" "root=UUID=362b39ad-6169-42bb-9c20-0e5fe5a2ac8e rw rootflags=subvol=Artix initrd=Artix\boot\initramfs-linux.img initrd=Artix\boot\amd-ucode.img"
% cat etc/fstab
UUID=D0DD-1172 /boot/efi vfat rw,defaults 0 2
UUID=362b39ad-6169-42bb-9c20-0e5fe5a2ac8e / btrfs rw,subvol=/Artix 0 1
UUID=20a5840f-4988-4848-a9da-abfc264df2bf /home/data ext2 rw,defaults 0 2
/dev/nvme0n1p5 none swap sw 0 2
/dev/nvme1n1p9 none swap sw 0 2
/dev/sda3 none swap sw 0 2
/dev/sdb3 none swap sw 0 2
% ls -Sal boot
total 110208
-rw------- 1 root  root 69804545 Apr  4 18:18 initramfs-linux-fallback.img
-rw------- 1 root  root 30535837 Apr  4 18:17 initramfs-linux.img
-rw-r--r-- 1 root  root 12498272 Apr  4 18:17 vmlinuz-linux
-rwxr-xr-x 1 root  root      274 Apr  4 20:03 refind_linux.conf
drwxr-xr-x 1 root  root      184 Apr  4 20:37 .
drwxr-xr-x 1 root  root      160 Apr  4 19:05 ..
drwxrwxr-x 1 artix root        0 Apr  4 18:21 efi
drwxrwxr-x 1 artix root        0 Apr  4 18:21 efi0
drwxrwxr-x 1 artix root        0 Apr  4 18:21 efi1
drwxrwxr-x 1 artix root        0 Apr  4 18:21 efi2
% sudo blkid
/dev/nvme0n1p1: UUID="D0DD-1172" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="rEFInd" PARTUUID="e7633eec-bb60-47f0-bf15-a3554dcb9db1"
/dev/nvme0n1p2: UUID="362b39ad-6169-42bb-9c20-0e5fe5a2ac8e" UUID_SUB="3855af24-f7db-42ee-a994-26e8aeda8d8b" BLOCK_SIZE="4096" TYPE="btrfs" PARTLABEL="artix" PARTUUID="5088d536-1ace-4a38-ba83-f41590671173"
%
:) AMD APU R4750G Zen2 Lucienne-G GCN Vega8 :) ASRock DeskMini X300 AMD edition :) (14.9+46.9)GiB SoDiMM DDR4 RAM’s
:) Samsung 990PRO HS NVMe SSD 3.63TiB (nda0; with 2.61TiB ZPool) :) Kingston NV2 NVMe SSD 3.63TiB (nvme1n1; with 2.7TiB ZPool)
:) Samsung 860QVO 2.5’’ SSD 3.63TiB (sda; with 2.1TiB ZPool) :) Transcend 220Q 2.5’’ SSD 1.82TiB (sdb; with 1.29TiB ZPool)
:) Intehill 4K UHD LED-IGZo screen

Re: [Q] Booting Artix installed on BtrFS by rEFInd

Reply #1
I don't expect you need the rootflags=subvol=Artix bit. Not something I've ever used. Just the UUID of the partition should be enough ?
Quote
initrd=Artix\boot\
Lose the Artix bit
This is mine (just for reference)
Code: [Select]
"Boot with standard options"  "rw root=UUID=fd6f6caa-08c4-4f14-9667-de7de40fae69 initrd=/boot/amd-ucode.img initrd=/boot/initramfs-linux.img resume=UUID=9e8f550f-586c-4258-ae5b-3b4c8b6e947"
"Boot to single-user mode"    "rw root=UUID=fd6f6caa-08c4-4f14-9667-de7de40fae69 single"
"Boot with minimal options"   "rw root=/dev/nvme0n1p1"
In reality my first line actually contains some more kernel options but I've removed them for clarity and in case you thought  you might need to copy them.
If you want swap partition based hibernation resume=UUID= should be the UUID of the swap partition. Otherwise you don't need or want that bit.

Edit:
I just noticed. You've used back slashes '\'  as directory separators. They should surely be forward slashes '/' ?

 

Re: [Q] Booting Artix installed on BtrFS by rEFInd

Reply #2
You missed that my root is on an BtrFS subvol and is on a Samsung NVMe SSD
(When my Artix root isn't on BtrFS refind_linux.conf won't even be required
https://rodsbooks.com/refind/drivers.html
The rEFInd founder also mentioned to have BtrFS subvols explicitly instructed to be scanned for rEFInd booting
http://www.rodsbooks.com/refind/mkrlconf.html
Also, generating a sample refind_linux.conf for BtrFS root also requires such a script, though nothing specifically written for BtrFS subvol roots

So, nothing is wrong, BtrFS rEFInd doesn't work well on RAID which has been now however disabled on BIOS, but was enabled when the BtrFS partition is made
So why my Artix kernel on an BtrFS subvol is still hidden from rEFInd?
Code: [Select]
% cat /boot/refind_linux.conf /etc/fstab
"Artix" "rw root=/dev/nvme0n1p2 rootflags=subvol=Artix initrd=Artix\boot\initramfs-linux.img"
"Artix fallback mode" "rw root=/dev/nvme0n1p2 rootflags=subvol=Artix initrd=Artix\boot\initramfs-linux-fallback.img single"
"Artix single user mode" "rw root=/dev/nvme0n1p2 rootflags=subvol=Artix initrd=Artix\boot\initramfs-linux.img single"
"Artix with AMD mu-code upgrades" "rw root=/dev/nvme0n1p2 rootflags=subvol=Artix initrd=Artix\boot\amd-ucode.img"
UUID=D0DD-1172 /boot/efi vfat rw,defaults 0 2
UUID=362b39ad-6169-42bb-9c20-0e5fe5a2ac8e / btrfs defaults,noatime,subvol=Artix,compress=lzma 0 0
UUID=20a5840f-4988-4848-a9da-abfc264df2bf /home/data ext2 rw,defaults 0 2
/dev/nvme0n1p5 none swap sw 0 2
/dev/nvme1n1p9 none swap sw 0 2
/dev/sda3 none swap sw 0 2
/dev/sdb3 none swap sw 0 2
% l /boot
total 91824
-rw------- 1 root      root 55032818 Apr  6 08:15 initramfs-linux-fallback.img
-rw------- 1 root      root 26429337 Apr  6 08:13 initramfs-linux.img
-rw-r--r-- 1 root      root 12498272 Apr  6 08:13 vmlinuz-linux
-rw-r--r-- 1 root      root    51200 Feb 18 15:53 amd-ucode.img
drwxr-xr-x 3 root      root     4096 Jan  1  1970 efi
-rwxr-xr-x 1 root      root      457 Apr  6 07:06 refind_linux.conf
drwxr-xr-x 1 root      root      210 Apr  6 08:15 .
drwxr-xr-x 1 root      root      160 Apr  4 19:05 ..
drwxrwxr-x 1 hd_scania root        0 Apr  4 18:21 efi0
drwxrwxr-x 1 hd_scania root        0 Apr  4 18:21 efi1
drwxrwxr-x 1 hd_scania root        0 Apr  4 18:21 efi2
% doas mount -a && cat /boot/efi/efi/rEFInd/rEFInd.conf|grep also_scan_dirs
also_scan_dirs Artix/boot
also_scan_dirs boot,ESP2:EFI/linux/kernels
also_scan_dirs boot,@/boot
also_scan_dirs +,@/kernels
%
:) AMD APU R4750G Zen2 Lucienne-G GCN Vega8 :) ASRock DeskMini X300 AMD edition :) (14.9+46.9)GiB SoDiMM DDR4 RAM’s
:) Samsung 990PRO HS NVMe SSD 3.63TiB (nda0; with 2.61TiB ZPool) :) Kingston NV2 NVMe SSD 3.63TiB (nvme1n1; with 2.7TiB ZPool)
:) Samsung 860QVO 2.5’’ SSD 3.63TiB (sda; with 2.1TiB ZPool) :) Transcend 220Q 2.5’’ SSD 1.82TiB (sdb; with 1.29TiB ZPool)
:) Intehill 4K UHD LED-IGZo screen

Re: [Q] Booting Artix installed on BtrFS by rEFInd

Reply #3
You missed that my root is on an BtrFS subvol
Yep you got me. I clearly did.
So with btrfs subvol's are you supposed to reverse the directory separators ? Still looks odd to me.
And the Artix at the front of every path. You sure that's right? It you've already referenced this subvol with rootflags=subvol=Artix why at the start of every path ? All looks odd. But then I've never used btrfs subvol's and I imagine I never will. Something along the lines of "You can't teach a old dog new tricks". And KISS.


Re: [Q] Booting Artix installed on BtrFS by rEFInd

Reply #4
Just a thought, but I could be wrong:

In your "also_scan_dirs" entries, try putting a "+," at the beginning of the 2nd and 3rd lines so it looks like this:

Code: [Select]
also_scan_dirs Artix/boot
also_scan_dirs +,boot,ESP2:EFI/linux/kernels
also_scan_dirs +,boot,@/boot
also_scan_dirs +,@/kernels

Something tells me that you are overwriting the 1st line with the 2nd line, and then overwriting the 2nd line with the 3rd line.

From refind.conf:

Code: [Select]
# The "+" symbol denotes appending to the list of scanned
# directories rather than overwriting that list.

Re: [Q] Booting Artix installed on BtrFS by rEFInd

Reply #5
I'm quite sure my syntazzes are ok, but why is such an Artix root on an BtrFS subvol still hidden by sth wrong?
Code: [Select]
"Artix"                                 "root=PARTUUID=5088d536-1ace-4a38-ba83-f41590671173 rw rootflags=subvol=Artix initrd=Artix\boot\initramfs-linux.img"
"Artix fallback mode"                   "root=PARTUUID=5088d536-1ace-4a38-ba83-f41590671173 rw rootflags=subvol=Artix initrd=Artix\boot\initramfs-linux-fallback.img single"
"Artix single user mode"                "root=PARTUUID=5088d536-1ace-4a38-ba83-f41590671173 rw rootflags=subvol=Artix initrd=Artix\boot\initramfs-linux.img single"
"Artix with AMD mu-code upgrades"       "root=PARTUUID=5088d536-1ace-4a38-ba83-f41590671173 rw rootflags=subvol=Artix initrd=Artix\boot\amd-ucode.img"
https://wiki.archlinux.org/title/REFInd#refind_linux.conf
:) AMD APU R4750G Zen2 Lucienne-G GCN Vega8 :) ASRock DeskMini X300 AMD edition :) (14.9+46.9)GiB SoDiMM DDR4 RAM’s
:) Samsung 990PRO HS NVMe SSD 3.63TiB (nda0; with 2.61TiB ZPool) :) Kingston NV2 NVMe SSD 3.63TiB (nvme1n1; with 2.7TiB ZPool)
:) Samsung 860QVO 2.5’’ SSD 3.63TiB (sda; with 2.1TiB ZPool) :) Transcend 220Q 2.5’’ SSD 1.82TiB (sdb; with 1.29TiB ZPool)
:) Intehill 4K UHD LED-IGZo screen

Re: [Q] Booting Artix installed on BtrFS by rEFInd

Reply #6
Maybe this fixes everything :)
Code: [Select]
also_scan_dirs +,Artix/boot
also_scan_dirs +,boot,ESP2:EFI/linux/kernels
also_scan_dirs +,boot,@/boot
also_scan_dirs +,@/kernels
Just a thought, but I could be wrong:

In your "also_scan_dirs" entries, try putting a "+," at the beginning of the 2nd and 3rd lines so it looks like this:

Code: [Select]
also_scan_dirs Artix/boot
also_scan_dirs +,boot,ESP2:EFI/linux/kernels
also_scan_dirs +,boot,@/boot
also_scan_dirs +,@/kernels

Something tells me that you are overwriting the 1st line with the 2nd line, and then overwriting the 2nd line with the 3rd line.

From refind.conf:

Code: [Select]
# The "+" symbol denotes appending to the list of scanned
# directories rather than overwriting that list.
:) AMD APU R4750G Zen2 Lucienne-G GCN Vega8 :) ASRock DeskMini X300 AMD edition :) (14.9+46.9)GiB SoDiMM DDR4 RAM’s
:) Samsung 990PRO HS NVMe SSD 3.63TiB (nda0; with 2.61TiB ZPool) :) Kingston NV2 NVMe SSD 3.63TiB (nvme1n1; with 2.7TiB ZPool)
:) Samsung 860QVO 2.5’’ SSD 3.63TiB (sda; with 2.1TiB ZPool) :) Transcend 220Q 2.5’’ SSD 1.82TiB (sdb; with 1.29TiB ZPool)
:) Intehill 4K UHD LED-IGZo screen

Re: [Q] Booting Artix installed on BtrFS by rEFInd

Reply #7
Yes maybe, although I don't think you need the "+," for the first line.

Or you could just do this probably:

Code: [Select]
also_scan_dirs Artix/boot,boot,ESP2:EFI/linux/kernels,boot,@/boot,@/kernels

(Put them all in one line)

And I notice that if you do that, then "boot" is in there twice.  I think you do not need all of those entries anyway.  Probably all you need is the first line "also_scan_dirs Artix/boot" and you could just comment the other three.  This is assuming that "Artix/boot" works properly for your specific BtrFS situation, which I have no experience with so could not say, but I think what you more likely want is this:

Code: [Select]
also_scan_dirs Artix:boot

This is assuming the partition where your /boot is located is labeled as "Artix".  Though I'm wondering if that's what "@/boot" looks for (maybe "@"  means all partitions?

One thing I will say, is that I had trouble with rEFInd myself until I changed my boot parition mounting location.  Rather than mounting the boot partition to /boot/efi I mounted it to /boot and then ran mkinitcpio again so that the kernel images rEFInd was looking for were actually on the boot partition where rEFInd was located.  This fixed all the issues I was having, because in rEFInd's configuration it states that when you reference a directory path it will assume you are referencing it on the partition where rEFInd is located.

Mind you that was for using a custom stanza in refind.conf, and now I'm using refind_linux.conf successfully so I suppose now that I think about it I could have left it as is and instead added a also_scan_dirs entry for it to look where I needed it to... maybe I'll try that so I'm not deviating from Artix/Arch standards.