Remix.run Logo
toyg 7 hours ago

Is zfs really worth the hassle, for someone who does not have time to play "home sysadmin" more than once or twice a year?

I've just rebuilt my little home server (mostly for samba, plus a little bit of docker for kids to play with). It has a hardware raid1 enclosure, with 2TB formatted as ext4, and the really important stuff is sent to the cloud every night. Should I honestly bother learning zfs...? I see it popping up more and more but I just can't see the benefits for occasional use.

elevation 3 hours ago | parent | next [-]

> can't see the benefits for occasional use

I've lost work and personal data to bit rot in NAS filesystems before. Archived VM images wouldn't boot anymore after months in storage. Multiple vacation photos became colorful static part way through on disk due to a bit flip in the middle of the JPEG stream. I've had zero issues since switching to ZFS (even without ECC.)

Another huge benefit of ZFS is the copy-on-write (CoW) snapshots, which saved me many times as an IT administrator. It was effortless to restore files when users accidentally deleted them, and recovering from a cryptolocker type attack is also instant. Without CoW, snapshots are possible, but they're expensive and slow. I saw a 20-user office try to snapshots on their 30TB Windows Server NAS hoping to avoid having to revert to tape backups to recover the occasional accidentally deleted file. While hourly snapshots would have been ideal, the NAS only had room for only two snapshots, and would crawl to a halt while it created them. But ZFS's performance won't suffer if you snapshot every minute.

When it's time to backup, ZFS' send/recv capability means you only ever move the differences when backing up, and they're pre-computed so you don't have to re-index an entire volume to determine that you only need to move 124KB, making small transfers are lightning fast. Once backup completes, you have verified that the snapshot on both sides is bit-for-bit identical. While this is the essential property of a backup, most filesystems cannot guarantee it.

ZFS has become a hard requirement for any storage system I build/buy.

yjftsjthsd-h 5 hours ago | parent | prev | next [-]

> Is zfs really worth the hassle, for someone who does not have time to play "home sysadmin" more than once or twice a year?

I'd argue that it's better for minimizing sysadmin work than the alternatives. Running a scrub, replacing a disk, taking a snapshot, restoring a snapshot, sending a snapshot somewhere (read: trivial incremental backups), etc. are all one command, and it's easy to work with.

> I've just rebuilt my little home server (mostly for samba, plus a little bit of docker for kids to play with). It has a hardware raid1 enclosure, with 2TB formatted as ext4, and the really important stuff is sent to the cloud every night. Should I honestly bother learning zfs...? I see it popping up more and more but I just can't see the benefits for occasional use.

The reason I personally would prefer it in that situation is that I don't really trust the layers under the filesystem to protect data from corruption or even to notice when it's corrupted. If you're sufficiently confident that your hardware RAID1 will always store data correctly and never mess it up, then it's close enough. (I wouldn't trust it, but that's me.) At that point, the only benefit I see to ZFS would be snapshots; an incremental `zfs send` is more efficient than however else you're syncing to the cloud.

toast0 6 hours ago | parent | prev | next [-]

IMHO, there's not much hassle anymore, unless you seek it out. The FreeBSD installer will install to zfs just as well as ufs. This article seems to not take the least hassle path.

Backups using zfs snapshots are pretty nice; you can pretty easily do incremental updates. zfs scrub is great to have. FreeBSD UFS also has snapshots, but doesn't have a mechanism to check data integrity: fsck checks for well formed metadata only. I don't think ext4 has snapshots or data integrity checking, but I haven't looked at it much.

There are articles and people claiming you need ECC to run zfs or that you need an unreasonable amount of memory. ECC is nice to have, but running ZFS without ECC isn't worse than running any other filesystem without ECC; and you only really need a large amount of ram if you run with deduplication enabled, but very few use cases benefit from deduplication, so the better advice is to ensure you don't enable dedup. I wouldn't necessarily run zfs on something with actually small memory like a router, but then those usually have a specialized flash filesystem and limited writes anyway.

nagaiaida 5 hours ago | parent | next [-]

> you only really need a large amount of ram if you run with deduplication enabled, but very few use cases benefit from deduplication, so the better advice is to ensure you don't enable dedup

a lot of people parrot this, but you can always just check for yourself. the in-memory size of the dedupe tables scales with total writes to datasets with deduplication enabled, so for lots of usecases it makes sense to enable it for smaller datasets where you know it'll be of use. i use it to deduplicate fediverse media storage for several instances (and have for years) and it doesn't come at a noticeable ram cost.

e12e 4 hours ago | parent [-]

> i use it to deduplicate fediverse media storage for several instances (and have for years) and it doesn't come at a noticeable ram cost.

Nice usecase. What kind of overhead and what kind of benefits do you see?

Brian_K_White 5 hours ago | parent | prev [-]

The difference is zfs does a lot of work and makes a lot of promises that it proved the data is good at every step of the way while it's being handled, that other filesystems do not do.

So: "I copied the data and didn't really look at it much." and it ended up being corrupt,

is different from: "I promise I proved this is solid with math and logic." and it ended up being corrupt, complete with valid checksum that "proves" it's not corrupt.

A zfs scrub will actually destroy good data thanks to untrustworthy ram.

https://tadeubento.com/2024/aarons-zfs-guide-appendix-why-yo... "So roughly, from what Google was seeing in their datacenters, 5 bit errors in 8 GB of RAM per hour in 8% of their installed RAM."

It's not true to say that "Well all filesystem code has to rely on ram so it's all the same."

toast0 4 hours ago | parent [-]

ZFS says "once I've committed to disk, if the data changes, I'll let you know".

This works, regardless of if you have ram errors or not.

I will say that the reported error rate of 5 bit errors per 8 GB per hour in 8% of installed RAM seems incredibly high compared to my experience running on a fleet of about one to three thousand machines with 64-768 GB of ECC RAM. Based on that rate, assuming a thousand machines with 64 GB ram each, we should have been seeing about 3000 bit errors per hour; but ECC reports were rare. Most machines went through their 3-5 year life without reporting any correctable errors. Of the small handful of machines that had errors, most of them went from no errors to a concerning amount of errors in a short time and were shut down to have their ram replaced; a few threw uncorrectable errors, most of those threw a second uncorrectable shortly thereafter and had their ram replaced; there was one or two that would do about one correctable error per day and we let those run. There was one, maybe two that were having so many correctable errors that the machine check exceptions caused operational problems that didn't make sense until the hourly ECC report came up with a huge number.

The real tricky one without ECC is that one bit error a day case... that's likely to corrupt data silently, without any other symptoms. If you have a lot of bit errors, chances are the computer will operate poorly; you'll probably end up with some corrupt data, but you'll also have a lot of crashing and hopefully run a memtest and figure it out.

deltarholamda 6 hours ago | parent | prev | next [-]

If you are interested in keeping backups, including the ability to go back in time to recover accidentally deleted/changed files, then ZFS with its reliable snapshot facility is fantastic. Other file systems offer some version of this, e.g. btrfs, but they don't have the same reliability as ZFS.

Snapshots on ZFS are extremely cheap, since it works on the block level, so snapshots every hour or even 15 minutes are now doable if you so wish. Combine with weekly or monthly snapshots that can be replicated off-site, and you have a pretty robust storage system.

This is all home sysadmin stuff to be sure, but even if you just use it as a plain filesystem, the checksum integrity guarantees are worth the price of admission IMO.

FWIW, software RAID like ZFS mirrors or mdm is often superior to hardware raid especially for home use. If your raid controller goes blooey, which does happen, unless you have the exact same controller to replace it, you run a chance of not being able to mount your drives. Even very basic computers are fast enough to saturate the drives in software these days.

avtar 6 hours ago | parent | prev | next [-]

Learning effort aside, there’s also the ZFS hardware requirements issue. I bought a four bay NAS couple years ago and looked into TrueNAS. I (somewhat) remember coming across details such as ZFS benefitting from larger amounts of ECC RAM and higher number of drives than what I had. This post covers details about different types of caches and resource requirements:

https://www.45drives.com/community/articles/zfs-caching/

rabf 6 hours ago | parent | prev | next [-]

I found thst ZFS to be very simple to understand, everything is controlled by just two commands. Datasets are huge win over partitions which seem like such a weird relic of the past once you have tried datasets. Fairly confident you can grasp ZFS in a hour or 2, you can even make a zfs pool from files to mess around with.

layer8 5 hours ago | parent [-]

I never found a good non-tutorial introduction into ZFS concepts. Do you know any? By non-tutorial, I mean something that doesn’t focus on teaching you the command-line tooling. Like you can explain to someone how Git works conceptually in detail, without having to mention any Git commands and having them exercise some Git workflow hands-on.

e12e 4 hours ago | parent [-]

Did you read the fine manual?

https://openzfs.github.io/openzfs-docs/man/master/7/zpoolcon...

https://openzfs.github.io/openzfs-docs/man/master/8/zpool.8....

https://openzfs.github.io/openzfs-docs/man/master/8/zfs.8.ht...

layer8 19 minutes ago | parent [-]

I have seen those, yes. These are reference materials, not an introductory presentation that explains the concepts and their relations, design rationale and use cases in context.

olavgg 7 hours ago | parent | prev | next [-]

The biggest advantage of ZFS from a operational experience, is that when you have problems, ZFS tells you why. Checksum errors? Something wrong with the hard drive or SATA/SAS cables. Is the disk slow, zfs events will tell you that it spent more than 5 seconds to read sector x from disk /dev/sdf. The zfs cli commands are super-intuitive, and makes fully sense. Compared to ie. virsh, which is just weird for managing vm's.

It definitely worth the hassle. But if everything works fine for you now, don't bother. ZFS is not going away and you can learn it later.

e12e 4 hours ago | parent | prev | next [-]

> Is zfs really worth the hassle

Yes. Also: what hazzle? It's in many ways simpler than alternatives.

mistyvales 6 hours ago | parent | prev | next [-]

I'd avoid hardware RAID controllers when using ZFS, unless you can put it into "IT" mode or equivalent.

whalesalad 6 hours ago | parent | prev [-]

zfs is the furthest thing from hassle, really trivial to use and manage. you'll sit down to do some kind of unhinged change to your infrastructure and it will end up taking 3 command line commands that complete instantly and then you will think, "huh, that was easy" and go back to the rest of your life