Artix Linux Forum

Artix Linux => Installation / Migration / Configuration => Topic started by: Erik R on 09 December 2018, 10:38:58

Title: [Solved] How I boot into a BTRFS raid as root fs
Post by: Erik R on 09 December 2018, 10:38:58
Hi,

I have a multi-linux setup where Artix is just on of them (and the latest). The root's are subvolumes on a BTRFS raid with 2 mirrored disks. This usually is no trouble but with Artix (and likely with Arch) there is.

Adding the btrfs-hook and make a new initramfs does not solve the problem. Nor was I able to use rootflags=device=/dev/sda2,device=/dev/sdb2 as a workaroud which used to work fine last time .

The problem seems to be that at the time btrfs scans for volumes the /dev/btrfs-control node is non-existent. A moment later, when at the rescue shell, it does exist.  A sleep-timer before the scan did not help though manually creating the node did.

This is how I modified the BTRFS run-hook (/usr/lib/initcpio/hooks/btrfs) so it works for me:
(mknode is taken from the BTRFS problem FAQ)

Code: [Select]
#!/usr/bin/ash

run_hook() {
    mknod /dev/btrfs-control c 10 234
    btrfs device scan
}

# vim: set ft=sh ts=4 sw=4 et:

I also had to remove the device= options from the kernel command line and I only point out on the the devices in the raid as root fs beside the  subvol=

Cheers,
Erik

Title: Re: [Solved] How I boot into a BTRFS raid as root fs
Post by: nous on 10 December 2018, 13:44:38
Thanks for the troubleshooting, I'll put this on the wiki.