You are not logged in.

#1 2022-02-14 22:50:41

codefossa
Member
Registered: 2022-02-14
Posts: 8

[SOLVED] BTRFS Root Partition with EFISTUB

I'm having issues using a btrfs subvolume as my root partition.  While booting, I'm receiving the following:

A start job is running for /dev/disk/by-uuid/d7203f69-7b1c-4411-be2c-382f3bc9b9a6 (9s / 1min 30s)

So, I've stopped mounting by UUID in fstab to confirm that the issue is coming from the boot manager.  I'll output what information I think is important below.

$ sudo btrfs subvolume list /mnt
ID 256 gen 44 top level 5 path arch
ID 257 gen 23 top level 5 path home
$ lsblk -f
NAME        FSTYPE FSVER LABEL            UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1                                                                                       
├─nvme0n1p1 vfat   FAT32 SYSTEM           B0C2-C76D                                           
├─nvme0n1p2                                                                                   
├─nvme0n1p3 ntfs         Windows          5A34BE3D34BE1C47                                    
├─nvme0n1p4 ntfs         Windows RE tools 6A4E236C4E232FED                                    
├─nvme0n1p5 vfat   FAT32 BOOT             6E6E-B96C                             453.5M    11% /boot
├─nvme0n1p6 ext4   1.0   home             d664891f-590d-413b-86db-c8a104438a31   16.3G    70% /home
├─nvme0n1p7 btrfs        data             d7203f69-7b1c-4411-be2c-382f3bc9b9a6  194.5G    24% /mnt
└─nvme0n1p8 ext4   1.0   arch             2a5437a7-2abe-4e85-9b59-6932ef591399    6.2G    64% /
$ cat /mnt/arch/etc/fstab 
# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>

/dev/nvme0n1p7 / btrfs defaults,subvolid=256 0 1
/dev/nvme0n1p7 /home btrfs defaults,subvolid=257 0 1

UUID=6E6E-B96C /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2

And here is the command I'm using to create the boot entry, which when booted into gives the earlier mentioned message.

sudo efibootmgr --disk /dev/nvme0n1 --part 5 --create --label "Arch Linux BTRFS" --loader /vmlinuz-linux --unicode 'root=UUID=d7203f69-7b1c-4411-be2c-382f3bc9b9a6 rootfstype=btrfs rootflags=subvolid=256 rw initrd=\initramfs-linux.img' --verbose

Lastly, here is an image of my boot attempt in case there's anything useful that I didn't provide.

https://i.ibb.co/JkDKYwb/boot-btrfs.jpg

Thank you in advanced for any help you may be able to provide.


Mod Edit - Replaced oversized image with link.
CoC - Pasting pictures and code

Last edited by codefossa (2022-02-15 15:04:18)

Offline

#2 2022-02-15 07:13:40

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] BTRFS Root Partition with EFISTUB

Use the 'file' command on vmlinuz-linux (on the EFI system partition) and check that the version matches that found under /lib/modules/ (on the root partition). That error message is usually seen when the installed modules don't match the booted kernel version so the kernel can't load the filesystem module needed to find the root partition.

If the versions don't match then mount the root subvolume and ESP correctly from the Arch live ISO, arch-chroot in and reinstall the kernel package with

# pacman -Syu linux

If the versions match then please post the output of

efibootmgr -uv
blkid

Jin, Jîyan, Azadî

Offline

#3 2022-02-15 12:13:51

codefossa
Member
Registered: 2022-02-14
Posts: 8

Re: [SOLVED] BTRFS Root Partition with EFISTUB

$ file /boot/vmlinuz-linux 
/boot/vmlinuz-linux: Linux kernel x86 boot executable bzImage, version 5.16.9-arch1-1 (linux@archlinux) #1 SMP PREEMPT Fri, 11 Feb 2022 22:42:06 +0000, RO-rootFS, swap_dev 0X9, Normal VGA
$ ls /mnt/arch/lib/modules/
5.16.9-arch1-1
$ efibootmgr -uv
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0002,0000,0001,0006,9999
Boot0000* Arch Linux	HD(5,GPT,1c99dd85-ec2b-46cf-a270-54fd8de13da7,0x1008a800,0x100000)/File(\vmlinuz-linux)root=UUID=2a5437a7-2abe-4e85-9b59-6932ef591399 rw initrd=\initramfs-linux.img
Boot0001* Windows Boot Manager	HD(1,GPT,20df4c4b-50de-4b93-bdc0-817a55e26b89,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)䥗䑎坏S
Boot0002* Arch Linux BTRFS	HD(5,GPT,1c99dd85-ec2b-46cf-a270-54fd8de13da7,0x1008a800,0x100000)/File(\vmlinuz-linux)root=UUID=d7203f69-7b1c-4411-be2c-382f3bc9b9a6 rootfstype=btrfs rootflags=subvolid=256 rw initrd=\initramfs-linux.img
Boot0006* Solid State Disk	PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-25-38-8A-91-C7-49-E7)/HD(1,GPT,20df4c4b-50de-4b93-bdc0-817a55e26b89,0x800,0x82000)
Boot9999* USB Drive (UEFI)	PciRoot(0x0)/Pci(0x1d,0x0)/USB(16,0)
/dev/nvme0n1p7: LABEL="data" UUID="d7203f69-7b1c-4411-be2c-382f3bc9b9a6" UUID_SUB="86081698-b072-42a0-bd63-f60a858d5d9c" BLOCK_SIZE="4096" TYPE="btrfs" PARTLABEL="data" PARTUUID="322d8cf6-abb0-4454-b3ec-dc9f665699f5"
/dev/nvme0n1p5: LABEL_FATBOOT="BOOT" LABEL="BOOT" UUID="6E6E-B96C" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="boot" PARTUUID="1c99dd85-ec2b-46cf-a270-54fd8de13da7"
/dev/nvme0n1p3: LABEL="Windows" BLOCK_SIZE="512" UUID="5A34BE3D34BE1C47" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="bdd4a7ef-f4ef-46d2-990d-ac97aa770844"
/dev/nvme0n1p1: LABEL_FATBOOT="SYSTEM" LABEL="SYSTEM" UUID="B0C2-C76D" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="20df4c4b-50de-4b93-bdc0-817a55e26b89"
/dev/nvme0n1p8: LABEL="arch" UUID="2a5437a7-2abe-4e85-9b59-6932ef591399" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="arch" PARTUUID="535a1ce9-f5be-4119-9874-cb5853e99062"
/dev/nvme0n1p6: LABEL="home" UUID="d664891f-590d-413b-86db-c8a104438a31" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="home" PARTUUID="19c0a2ca-5fc4-4844-809f-94b93012d805"
/dev/nvme0n1p4: LABEL="Windows RE tools" BLOCK_SIZE="512" UUID="6A4E236C4E232FED" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="5be38d9d-b0ff-4928-931a-b0029251a457"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="abf4de63-a155-4caf-9d45-28dd11fcfd5d"

In the above, nvme0n1p7 is my btrfs partition with the two subvolumes on it, and in efibootmgr the entry I'm having problems with is "Arch Linux BTRFS".  My current setup with ext4 is still there so I can continue to boot and use my PC until I figure out the btrfs issues.

I should also say, I set these subvolumes up by using rsync on my existing arch partitions.  I can boot into it perfectly fine with my data on ext4 partitions.  Also, they are sharing the boot partition, which is nvme0n1p5 above.

Last edited by codefossa (2022-02-15 12:14:45)

Offline

#4 2022-02-15 13:52:24

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

Re: [SOLVED] BTRFS Root Partition with EFISTUB

Does your initramfs contain the btrfs module? If you didn't add it to MODULES and autodetect was used when you generated the image using the ext4 root, it's probably not included.

Last edited by Raynman (2022-02-15 13:53:02)

Offline

#5 2022-02-15 15:03:49

codefossa
Member
Registered: 2022-02-14
Posts: 8

Re: [SOLVED] BTRFS Root Partition with EFISTUB

Raynman wrote:

Does your initramfs contain the btrfs module? If you didn't add it to MODULES and autodetect was used when you generated the image using the ext4 root, it's probably not included.

Thank you very much!  This resolved my issue.

Some details in case anyone else finds this and runs into the same problem.  I needed to edit mkinitcpio.conf and add btrfs to the hooks and regenerate.

$ sudo nano /etc/mkinitcpio.conf
HOOKS=(base systemd autodetect modconf block filesystems keyboard fsck btrfs)

Then to regenerate, we simply run:

sudo mkinitcpio -p linux

Offline

#6 2022-02-15 15:06:07

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

Re: [SOLVED] BTRFS Root Partition with EFISTUB

The btrfs hook is only needed for muilti-device btrfs setups. Raynman was talking about a module, not a hook.

Last edited by Scimmia (2022-02-15 15:09:31)

Offline

#7 2022-02-15 15:09:41

codefossa
Member
Registered: 2022-02-14
Posts: 8

Re: [SOLVED] BTRFS Root Partition with EFISTUB

Scimmia wrote:

The btrfs hook is only needed for muilti-device btrfs setups.

Does this mean that really the only thing that needed done was the following?

sudo mkinitcpio -p linux

It worked after doing the two steps in my previous post, and I did it while booted into the ext4 volumes.

Offline

#8 2022-02-15 15:11:34

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

Re: [SOLVED] BTRFS Root Partition with EFISTUB

Re-read what Raynman wrote. He asked a question you didn't answer, or probably even check.

Offline

#9 2022-02-15 15:13:21

codefossa
Member
Registered: 2022-02-14
Posts: 8

Re: [SOLVED] BTRFS Root Partition with EFISTUB

Scimmia wrote:

Re-read what Raynman wrote. He asked a question you didn't answer, or probably even check.

When I ran the following before doing my previous steps, nothing was returned, so I assumed yes he was correct.  Now when I run it, btrfs is returned.

$ sudo mkinitcpio -M | grep btrfs
btrfs

Offline

#10 2022-02-15 15:26:01

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

Re: [SOLVED] BTRFS Root Partition with EFISTUB

So if that's all you need, why would you add the entire hook instead of just that one module?

Offline

#11 2022-02-15 15:40:37

codefossa
Member
Registered: 2022-02-14
Posts: 8

Re: [SOLVED] BTRFS Root Partition with EFISTUB

Scimmia wrote:

So if that's all you need, why would you add the entire hook instead of just that one module?

Because from what I could find of other peoples' setups using btrfs, that's what I saw being used.  I simply didn't know any better.  I've added it as a module and removed it from the hooks and it is working as expected.

Thanks for helping.

Offline

Board footer

Powered by FluxBB