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.
Not answering your question but I had installed btrfs on my fedora install, thought I would use it for backups and system restores using snapshots.
But I felt there was always a performance tradeoff when doing a lot of writes like npm install and stuff.
Eventually replaced btrfs with ext4 and backup solution like timeshift.
I would say if you want system recovery then tools like timeshift make it really really simple and straightforward taking backups and restoring them.
Sometimes you just don’t need a Swiss army knife to do most basic stuff.
Using a filesystem which has NONE of modern features because you “noticed” performance tradeoffs…
I wasn’t familiar with timeshift so I took a look at it. My primary use case for snapshots is to take one before updates. So I can load from the snapshot if there’s issues. It doesn’t look like using it with ext4 would fulfill this use-case. But it looks like it also supports btrfs snapshots so could be useful as a UI to configure that.
The backups with time shift are incremental, hence most of the time the backup is taken within seconds and it only stores changes over time, something similar to git.
I used to do it exactly for that uses case, the backup was quick because there generally are not much changes outside the home directory.
I used to have Daily backups and monthly backup like 20 different dates stored in a relatively small space.
Like if my system is 30 gb then a 50 gb backup partition would store months of daily backups.
Ext4 on LVM can do both volume mirroring and snapshots. The is no COW support with ext4 though.
By the way I use BTRFS with LUKS on my workstation and have for 4 or 5 years. Primarily I like it for the snapshoting. I though I would like COW but frankly very mixed on that especially since there are cases you should not use COW and if you disable COW you loose snapshotting on that file. I have not used the raid capability. One thing I do not like about BTRFS is that I know of no way to track a bad block at the sector level to what file it is in if any. With Ext4 you can.
Another useful backup tool is restic.