Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Can't include BTRFS into initramfs (Read 718 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Can't include BTRFS into initramfs

Hi there.
Just tried installing Artix on Luks+BtrFS.
The problem is that when initramfs tries to mount /dev/mapper/root (Decrypted LUKS partition) it fails because it doesn't recognize BTRFS filesystem.
Code: [Select]
:: running early hook [udev]
Starting systemd-udevd version 253.3-3-arch
:: running hook [udev]
:: Triggering uevents...
:: running hook [keymap]
:: Loading keymap...done.
:: running hook [encrypt]

A password is required to access to root volume:
Enter passpharse for /dev/nvme1n1p5:
:: preforming fsck on '/dev/mapper/root'
:: mounting '/dev/mapper/root' on real root
mount: /new_root: unknown filesystem type 'btrfs'.
       dmesg(1) may have more information after failed mount system call.
You are now being dropped into an emergency shell.
sh: can't access tty; job control turned  off
[rootfs ]# ls /dev/mapper/
control root
[rootfs ]# btrfs
sh: btrfs: not found
[rootfs ]# mount -t btrfs -o defaults,noatime,subvol=/@artix/@ /dev/mapper/root /new_root/
mount: /new_root: unknown filesystem type 'btrfs'.
       dmesg(1) may have more information after failed mount system call.
[rootfs ]# _
NOTE: There was nothing related to this in dmesg. Last entry had time 5.3~ seconds after boot and my mount command was executed wall after 5 seconds. Also I included image just in case.

Here are all of the details from hardware to configuration:

Host: Dell Precision 7740 (Laptop)
CPU: Intel i7-9750H @ 4.5GHz
RAM: 32GB
GPU: Quadro RTX 3000 Mobile / Max-Q

Drives/partition layout:
Code: [Select]
Drive 1 (256GB)
nvme0n1
├─nvme0n1p1  16M (some random windows partition)
└─nvme0n1p2  238.5G (windows 10 partition)
Drive 2 (2TB)
nvme1n1
├─nvme1n1p1  500M (EFI)
├─nvme1n1p2  1G (/boot for Arch [nvmen1n1p3])
├─nvme1n1p3  700G (Arch)
├─nvme1n1p4  1G  (/boot for Artix)
└─nvme1n1p5  1.1T  (Artix)

Artix (nvme1n1p5) btrfs structure:
Code: [Select]
ID 256 gen 16 top level 5 path @artix
ID 257 gen 152 top level 256 path @artix/@
ID 258 gen 117 top level 256 path @artix/@home
ID 259 gen 153 top level 256 path @artix/@root
ID 260 gen 12 top level 256 path @artix/@srv
ID 261 gen 146 top level 256 path @artix/@log
ID 262 gen 141 top level 256 path @artix/@var_cache
ID 263 gen 115 top level 256 path @artix/@yesnt_cache
ID 264 gen 16 top level 256 path @artix/@snapshot

'blkid' output:
Code: [Select]
/dev/mapper/artix: UUID="a2726a27-2290-4366-a7a3-ce996607bc04" UUID_SUB="1787fc05-eea1-4816-9714-ef9aeb39277b" BLOCK_SIZE="4096" TYPE="btrfs"
/dev/nvme0n1p1: PARTLABEL="Microsoft reserved partition" PARTUUID="9734724d-029c-4f2b-85b5-1cdfd4420cc8"
/dev/nvme0n1p2: BLOCK_SIZE="512" UUID="92786D12786CF5FF" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="e38e470c-a129-4023-b003-f288f4932bae"
/dev/mapper/root: UUID="886cb419-b7f7-4034-9a7d-85b7bd6cfbff" BLOCK_SIZE="4096" TYPE="ext4"
/dev/nvme1n1p4: UUID="173c4439-c051-477f-a6cc-1517e831870f" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="1d91978a-b575-4846-82ab-7ccadf85999b"
/dev/nvme1n1p2: LABEL="boot" UUID="0e6eb697-38ca-4d61-b957-5e7f1ffea9e2" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="464e1f87-6118-0f45-8650-ef52a1f0527e"
/dev/nvme1n1p5: UUID="ec38b4f4-c529-4e93-b111-48d2d3e4a1d7" TYPE="crypto_LUKS" PARTUUID="014d1d65-f094-3040-84de-f832db70c79f"
/dev/nvme1n1p3: UUID="df510390-1b29-431c-84f8-edf344d2cc63" TYPE="crypto_LUKS" PARTUUID="7de12da4-dcd2-2f4e-b5e4-15dbf6509f37"
/dev/nvme1n1p1: UUID="3467-3A95" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="49568d80-6ebb-43fb-bad9-dbfc2afab063"
NOTE: I needed to chroot into artix from my arch install to get this output so it's opened as /dev/mapper/artix, don't get confused with /dev/mapper/root.

Artix Details:
Installed using BASE-OPENRC image following Artix Wiki.
Didn't configure any additional repos, only `system`, `world` and `galaxy` are enabled.
`btrfs-progs` package is installed.

/etc/fstab:
Code: [Select]
# Static information about the filesystems.
# See fstab(5) for details.

# <file system>                                 <dir>                   <type>          <options>                                                               <dump>  <pass>
UUID=a2726a27-2290-4366-a7a3-ce996607bc04       /                       btrfs           rw,noatime,ssd,space_cache=v2,subvolid=257,subvol=/@artix/@             0       0
UUID=a2726a27-2290-4366-a7a3-ce996607bc04       /root                   btrfs           rw,noatime,ssd,space_cache=v2,subvolid=259,subvol=/@artix/@root         0       0
UUID=a2726a27-2290-4366-a7a3-ce996607bc04       /home                   btrfs           rw,noatime,ssd,space_cache=v2,subvolid=258,subvol=/@artix/@home         0       0
UUID=a2726a27-2290-4366-a7a3-ce996607bc04       /.snapshot              btrfs           rw,noatime,ssd,space_cache=v2,subvolid=264,subvol=/@artix/@snapshot     0       0
UUID=a2726a27-2290-4366-a7a3-ce996607bc04       /home/yesnt/.cache      btrfs           rw,noatime,ssd,space_cache=v2,subvolid=263,subvol=/@artix/@yesnt_cache  0       0
UUID=a2726a27-2290-4366-a7a3-ce996607bc04       /var/log                btrfs           rw,noatime,ssd,space_cache=v2,subvolid=261,subvol=/@artix/@log          0       0
UUID=a2726a27-2290-4366-a7a3-ce996607bc04       /var/cache              btrfs           rw,noatime,ssd,space_cache=v2,subvolid=262,subvol=/@artix/@var_cache    0       0

UUID=173c4439-c051-477f-a6cc-1517e831870f       /boot                   ext4            rw,relatime                                                             0       2
UUID=3467-3A95                                  /boot/efi               vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro   0       2
NOTE: All subvolumes are contained within '@artix' subvolume, because I plan to make multi system partition, because resizing LUKS is just.. pain.

/etc/mkinitcpio.conf:
Code: [Select]
MODULES=()
BINARIES=("/usr/bin/btrfs")
FILES=()
HOOKS=(base udev autodetect modconf block resume btrfs filesystems keyboard fsck)
NOTE: I didn't copy comments here and if someone was asking, YES, I have ran `mkinitcpio -P`, and YES, I had every partition mounted including boot.

Grub Entry For Artix (/boot/grub/grub.cfg)
Code: [Select]
menuentry 'Artix Linux' --class yesnt --class gnu-linux --class gnu --class os  'gnulinux-simple-aee07c59-1062-447f-b89e-bcbac39381a3' {
    echo '               <###> Loading Artix <###>'
    echo ' Loading Modules ...'
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_gpt
    insmod ext2
    echo ' Setting / to 0e6eb697-38ca-4d61-b957-5e7f1ffea9e2 ...'
    search --no-floppy --fs-uuid --set=root 0e6eb697-38ca-4d61-b957-5e7f1ffea9e2
    echo ' Loading Linux Kernel (/vmlinuz-linux) ...'
    linux /vmlinuz-linux cryptdevice=PARTUUID=014d1d65-f094-3040-84de-f832db70c79f:root root=/dev/mapper/root rootflags=subvol=/@artix/@ rw add_efi_memmap loglevel=3 nvidia_drm.modeset=1 usbcore.autosuspend=-1 sysrq_always_enabled=1
    echo ' Loading Initial Ramdisk (initramfs-linux.img / intel-ucode.img) ...'
    initrd /initramfs-linux.img /intel-ucode.img
}
submenu 'Advanced options for Artix Linux'  'gnulinux-advanced-7315dad2-d7ac-455d-8e77-e737315e66e6' {
    menuentry 'Boot using Defaults' --class yesnt --class gnu-linux --class gnu --class os  'gnulinux-linux-advanced-aee07c59-1062-447f-b89e-bcbac39381a3' {
        echo '               <###> Loading Artix <###>'
        echo ' Loading Modules ...'
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        echo ' Setting / to 0e6eb697-38ca-4d61-b957-5e7f1ffea9e2 ...'
        search --no-floppy --fs-uuid --set=root 0e6eb697-38ca-4d61-b957-5e7f1ffea9e2
        echo ' Loading Linux Kernel (/vmlinuz-linux) ...'
        linux /vmlinuz-linux cryptdevice=PARTUUID=014d1d65-f094-3040-84de-f832db70c79f:root root=/dev/mapper/root rootflags=subvol=/@artix/@ rw add_efi_memmap loglevel=3 nvidia_drm.modeset=1 usbcore.autosuspend=-1 sysrq_always_enabled=1
        echo ' Loading Initial Ramdisk (initramfs-linux.img / intel-ucode.img) ...'
        initrd /initramfs-linux.img /intel-ucode.img
    }
    menuentry 'Boot Using Fallback Initramfs (initramfs-linux-fallback.img / intel-ucode.img)' --class yesnt --class gnu-linux --class gnu --class os  'gnulinux-linux-fallback-aee07c59-1062-447f-b89e-bcbac39381a3' {
        echo '        < RECOVERY > Loading Artix < RECOVERY >'
        echo ' Loading Modules ...'
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        echo ' Setting / to 0e6eb697-38ca-4d61-b957-5e7f1ffea9e2 ...'
        search --no-floppy --fs-uuid --set=root 0e6eb697-38ca-4d61-b957-5e7f1ffea9e2
        echo ' Loading Linux Kernel (/vmlinuz-linux) ...'
        linux /vmlinuz-linux cryptdevice=PARTUUID=014d1d65-f094-3040-84de-f832db70c79f:root root=/dev/mapper/root rootflags=subvol=/@artix/@ rw add_efi_memmap loglevel=3 nvidia_drm.modeset=1 usbcore.autosuspend=-1 sysrq_always_enabled=1 single
        echo ' Loading Initial Ramdisk (initramfs-linux-fallback.img / intel-ucode.img) ...'
        initrd /initramfs-linux-fallback.img /intel-ucode.img
    }
}
NOTE: I know it looks kinda weird, but it's config I copied from my Arch Install because I don't use default `/etc/grub.d/10_linux` grub script.


If I have missed any config let me know.
I will try to provide it as soon as I can.
Thanks in advance!

 

Re: Can't include BTRFS into initramfs

Reply #1
Okay, so while I wasn't able to pinpoint single reason for this failure after reinstalling artix with slight modifications to install process I was able to get it working:
Code: [Select]
basestrap /mnt base base-devel openrc elogind-openrc btrfs-progs cryptsetup cryptsetup-openrc efibootmgr grub intel-ucode dhcpcd wpa_supplicant linux linux-firmware linux-headers mkinitcpio nano
/etc/mkinicpio.conf
Code: [Select]
BINARIES=(/usr/bin/btrfs)
HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)
I suspect some package other than `btrfs-progs` was missing.