Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [Solved] How I boot into a BTRFS raid as root fs (Read 1198 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Solved] How I boot into a BTRFS raid as root fs

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

I take full responsibility of my Linux systems - I just need some help from time to time.

 

Re: [Solved] How I boot into a BTRFS raid as root fs

Reply #1
Thanks for the troubleshooting, I'll put this on the wiki.