ZFS or LUKS/btrfs for my use case
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.
TFO Winder
in reply to JovialSodium • • •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.
JovialSodium
in reply to TFO Winder • • •TFO Winder
in reply to JovialSodium • • •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.
ikidd
in reply to JovialSodium • • •For a workstation, btrfs is probably fine. It's the shits at software RAID, but that's rarely a thing on a workstation.
Look at
btrfs-assistant
for adminstration. That's what Fedora ships with, I think it uses Snapper in the backend.JovialSodium
in reply to ikidd • • •I am using a RAID 1 mirror over two disks. So that's good to know. I'll do a little research and see if it's better to let mdadm handle that.
Doesn't look like that's in the void repo. But that's ok, I don't mind learning the command line tools.
𝕽𝖚𝖆𝖎𝖉𝖍𝖗𝖎𝖌𝖍
in reply to JovialSodium • • •IME, btrfs is easier to work with than ZFS. It has all of the features you asked for; its RAID ≠ 0/1/10 are buggy, but 0/1/10 are considered reliable. In the past year, I heard a rumor that they were going to announced RAID > 1 to be also stable, but that's hearsay; I haven't read anything authoritative on the subject - the Arch btrfs page and the btrfs man page both still say 5/6 are not reliable.
I've been using btrfs on a variety of computers and VMs, from tiny little ODROIDS, to laptops, to VPSes, to desktops for... over a decade? I've had much better reliability than ext4. I was attracted to the POLS of the commands, vs ZFS.
I don't know how much my opinion weighs; I have a feeling a data center person would suggest ZFS as being more "enterprise". I've been really happy with it. I've been watching bcachefs for the caching and target options - really neat features useful for home gamers - but otherwise I wouldn't bother - btrfs has been solid and done everything I could want. It was a huge upgrade from mdadm and lvm in UX, and was only possible when disks got so cheap they outpaced my need for RAID5, and I could afford multiple backup drives that held years worth of nightly incremental backups.
JovialSodium
in reply to 𝕽𝖚𝖆𝖎𝖉𝖍𝖗𝖎𝖌𝖍 • • •Hearing roughly a decade of successful use, especially on systems with constrained resources, certainly makes me lean further towards btrfs.
@ikidd@lemmy.world said that btrfs is poor at software RAID. I'll do a little research in to how it fares for RAID 1 vs mdadm. I don't see any reason I couldn't do mdadm>luks>btrfs if that's the better choice. But if btrfs is reliable and with comparable performance, I'd certainly rather do that.
𝕽𝖚𝖆𝖎𝖉𝖍𝖗𝖎𝖌𝖍
in reply to JovialSodium • • •I have no doubt ZFS is solid, too, FWIW. I leaned toward btrfs because it was simple, the commands straightforward and clear, nothing required more than one step - this is all super valuable to me because there are other things I want to spend my time on than fiddling with the filesystem.
You should check for yourself. I haven't used software RAID in years - RAID 0+1 gives me no value - but the btrfs team and Arch wiki say 0, 1, and 10 are solid. You should not use 5 or 6, as they're known to be buggy and even the btrfs man page tells you to not use it. So, yeah? btrfs is poor at RAID 5/6; to my understanding, it's good at 0/1/10.
btrfs can do encryption, compression, snapshots, and some RAID. I found combining mdadm and lvm and FS built a jenga tower, of which if part failed, the entire end result was borked. I once did an OS upgrade and lost the mdadm config, and spent two days recreating it. I never used it on a new machine after that. Separation of concerns is great, but having an all-in-one that can self repair and boot into snapshots is better.
I can't speak to performance. No doubt Toms of someone like that's looked into that in detail.
aksdb
in reply to 𝕽𝖚𝖆𝖎𝖉𝖍𝖗𝖎𝖌𝖍 • • •Personally I found ZFS far more simple. The userspace tools make more sense to me. Also I like, that volumes can have a default (relative) mount point attached. So in a recovery scenario, I simply have to open the zpool with a relative bath path, and then have all my volumes ready to go. If I want to recover a btrfs system with multiple subvolumes, I typically need to know exactly which ones and where to I have to mount (each individually).
Also I go really used to
zfsbootmenu
.deadcatbounce
in reply to JovialSodium • • •if you have a look at the btrfs mailing lists post that introduced RAID1c34, they were created because RAID56 were not considered viable or fixable. It's in couched language but reasonably clear. I don't think you're thinking of using those (RAID56) but don't.
Never had any btrfs problems that weren't self generated or date from a really sticky period in btrfs's history (years ago). I've used RAID56 until RAID1c34 became available and RAID10 where I could.
Haven't tried LUKS - btrfs though, although effectively no worse than putting btrfs in a VM, albeit a bit more computationally intensive.