I’d been using ZFS with Void linux on both my laptop and desktop for a couple of months. And ZFS is cool! But I’m thinking not great for my use case, especially for my laptop with it’s more constrained resources. Memory usage was a real problem, even after imposing low ARC limits. And the kernel module compile time was long enough to be a bit annoying, especially for a few kernels (I like to keep the last few around, to be safe) as it happens fairly often on a rolling release.
I switched the laptop to LUKS/btrfs a couple of days ago. And I’m thinking that was the correct choice for that. And now I’m considering doing the same for my desktop. As they seem comparable but btrfs is in-kernel and seemingly more system resource friendly. But before doing so I figured I’d ask the community about it. Maybe some important factors or features for either setup that I might not be considering.
Here’s the stuff I care about. All of which both offer, but I’m not an expert at either and I don’t know how equal they are.
- Disk encryption. For ZFS everything (except the EFI partition) is encrypted. I use ZFSBootMenu in this scenario. For the btrfs setup I have the kernel/initramfs on an ext2 partition. I do not store any decryption keys in the initramfs. I know grub can decrypt LUKS with limitations, but I prefer this setup. And it feels secure enough to me. Any pitfalls I’m missing?
- Pools/subvolumes
- Snapshots. ZFSBootmenu has an option to load a snapshot. For btrfs it looks like I’d need to create a subvolume from a snapshot, which in a recovery situation might mean doing this from recovery media. That’s ok, given this is an unlikely thing to encounter. But if anyone knows of an easier way, I’d love to hear it.
- CoW
- RAID 1
- Compression is nice, especially for the laptop
Edit: typo in title.
I’ve used BTRFS on a 4 disk RAID1 before for a year or two and it was fine for most things except for workloads where lots of small files are being accessed (like Databases or compiling a large project). I still use BTRFS for my boot drives because snapshots are handy but I switched my RAID to ZFS because it’s able to cope a lot better with Databases.
If you want compression in BTRFS you have to tell it via mount options and it’s also worth to mention that those options will apply to the entire Filesystem/Pool. It’s not like in ZFS where each Dataset is like its own thing. In BTRFS subvolumes are more like directories that get special treatment. Also BTRFS “snapshots” are just COW copies of subvolumes. Those copies can be read-write (default) or read-only.
I had my RAID also LUKS encrypted and the sucky part about that was that you have to unlock each drive individually. The only way to do this painlessly is to use a file as the encryption key and put it in a place where LUKS can access it. In my case that was easy to solve since the OS wasn’t on my RAID, so I just put the key file in
/usr/share
.For booting into snapshots as a recovery option there is grub-btrfs but you have to grub-mkconfig each time new snapshots get created for new snapshots to show up.