Talk:Bcachefs

From ArchWiki
Jump to navigation Jump to search

bcachefs multidevice as rootfs

Anyone have any good suggestions for getting a multi-device filesystem to play nice with Arch's initrd? Putting /dev/sda2:/dev/sdb1 / bcachefs defaults 0 0 in fstab seems to break grub-mkconfig's parser and init chokes, unable to mount the filesystem. So far I've added my own hook that just does an explicit mount -t bcachefs /dev/sda2:/dev/sdb1 /new_root which does mount it properly, but init still chokes when it tries to parse root= from the kernel cmdline. As a result, I'm given the recovery prompt and have to ctrl+d to continue booting.

I think with bcachefs-tools-gitAUR in the init I could do a more complex script using bcachefs show-super to identify all of the devices in the filesystem even if only one of them is in fstab (similar to how btrfs works), but I'm not sure how to override init's behavior with root=.

Best idea I have so far is making a /usr/bin/mount.bcachefs-multi (could just be a shell script depending on bcachefs-tools) which, given 1 block device from a bcachefs filesystem will attempt to find all block devices that make up that filesystem and then call mount -t bcachefs deva:devb:dev... . This should let me put bcachefs-multi in the fstab. But if there's a good way to override {{ic|1=root=} in the init, then that's probably a better solution. Bobpaul (talk) 23:21, 11 December 2019 (UTC)

The mount.bcachefs-multi trick was a dead end. I can do mount -t bcachefs-multi /dev/sda2 /new_root and it successfully constructs the mount -t bcachefs /dev/sda2:/dev/sdb1 /new_root command. But the init doesn't supply the filesystem type from fstab when attempting to mount, so this doesn't get me any further than the hook I was already using. Still searching for a way to avoid getting tossed to a shell during bootup. Bobpaul (talk) 20:45, 14 December 2019 (UTC)
The solution might be a custom initramfs. This reddit thread has some discussion to that end. However I would recommend using ext4 as root and bcachefs as /home or /var/lib. It's still easy to break, and the benefits are minor when using it for root compared to for data serving. I just made a simple mount-smb.service systemd unit for my NAS, which runs the mount command, and enabled it at startup. When it fails, which it has due to my own error, I can still easily get into the system to repair it. Vitruvius (talk) 09:15, 26 December 2019 (UTC)

Erasure Coding

Does it work at all? According to the blog post it's functional (despite filling hard drives with junk over time). I can turn it on on a fresh drive set, but it doesn't appear to do anything. It doesn't allow drives to fail, or take up more space, as I would expect from something like RAID 5. Vitruvius (talk)