Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> LVM. The old MBR way of partitioning is just awful.

Just wait until you find out about ZFS!



Honest question: can you explain the practical advantages of ZFS over LVM + Ext4? I understand that ZFS combines a filesystem and package manager, but why should I, a humble OSS user, care?


Not all of ZFS's advantages necessarily apply to "humble" uses like your home PC, but I can think of a few that surely do.

Filesystems share all available space in the pool. Say you have 16GB space available, so with LVM, you might make an 8GB /home and an 8GB /var. Later on, you've run out of space in /home while still having 4GB free in /var. What do? Well, you can probably get by with resize2fs followed by lvresize ... but this is not only cumbersome, but prone to catastrophic failures. With ZFS this is simply never an issue.

Snapshots. LVM has them too, of course, but they're not aware of files so they're far less useful. With ZFS, you can simply run `zfs diff` and it will pretty quickly tell you which files were added, modified, and deleted.

Building on this snapshot functionality, incremental backups become a breeze with `zfs send` and `zfs receive`, obviating the need for clunky (by comparison, at least) solutions like rsnapshot.

ZFS actively detects data corruption, by checksumming everything. Assuming you have redundancy (mirrors or raidz pools), it also automatically fixes them. It's often said that this is only relevant to "enterprises," but I'd disagree: I don't want to discover my personal files have been corrupted any more than an enterprise does their business files. A better argument is that this protection is incomplete if one is not using ECC RAM, however, a partial counter to that is that a lot of recent consumer hardware (namely, AMD's) does support ECC RAM.

Overall I'd say comparing ZFS to LVM+ext4/XFS/whatever is kind of comparing, say, Windows 95 to Windows 2000 (or Unix, if you prefer). It's just not a fair comparison, they're not even playing the same sport. A much more apt comparison would be to BTRFS, but ZFS has been rock-solid for longer than BTRFS has been in existence, and the latter has been eating people's data left and right for most of that time.

On the other hand, one downside to using ZFS at home is that you can't really add one drive at a time. Say you have a raidz2 (similar to RAID-6) pool with 6 drives in it. You can't just add a seventh. The ideal way to grow such a pool in ZFS would be to add a whole nother raidz2 "vdev", which would then be striped with the first one. That means buying 6 new drives, not 1.


Thanks so much for this detailed explanation, it really helped underscore the differences! Do you run ZoL or use FreeBSD?


I use both. On Debian stable, ZFS is a piece of cake, because the kernel version never changes. You just install the ZFS package (which is actively maintained) and call it a day. I imagine on something like Arch it could become quite a pain, though (never tried it myself).


A few more questions if you'll indulge me. First, how do you actually install ZFS on Debian? I understand you can install the ZFS package, but that in and of itself won't change the underlying filesystem on disk. Also, doesn't Ext4 also support checksumming? (See https://ext4.wiki.kernel.org/index.php/Ext4_Metadata_Checksu...).


Well, yes. You can't just convert filesystems in place, whether ZFS or otherwise. After installing the package you can create ZFS pools and filesystems. If you want to replace existing filesystems you would move all your stuff over after the fact.

Booting from ZFS will require some extra steps. I actually cheated here and just left /boot and / on ext4, using ZFS for /usr, /home, /var and everything else, so I don't have firsthand experience with this (on Linux anyway, on FreeBSD you can just select ZFS during installation). But if you do want that, it doesn't seem too difficult, https://openzfs.github.io/openzfs-docs/Getting%20Started/Deb...

As far as ext4 checksumming, as your own link says, it only checksums metadata -- actually, a subset of the metadata apparently. ZFS checksums everything, meaning your actual data. Further, since ext4 is not aware of redundancy -- you'd be using lvm or mdraid for that -- it's not clear what it can do if it does detect an error. With ZFS these errors are fixed automatically.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: