by xte · 7y ago · 0 comments
It deserve a future not different than SSH.
On GNU/Linux I "mimic" it with a classic poor man's solution (mdraid+LUKS+LVM+nilfs2), in the past I've used zfs first on OpenSolaris (SXDE/CE/Indiana) and after even on GNU/Linux but while remain a fantastic pioneer hammer being a logged fs is far superior.
Thanks so for the hard work!
Various loads, even if not really "high" in server-like terms, very few not-clean shutdowns, mostly for testing, few fs resize (both in grow and shrink senses) + LVM resize [2], regular sync of different desktops via unison + converting in ss (snapshot) the latest cp (checkpoint) and back again after sync.
The only real problem I found is cleaner process that's extremely slow so on frequently changing fs like root, home, var etc you need to tweak config a bit [3] to make cleaner far more aggressive or require really big free space to avoid fs full from time to time due to extra cp saved...
That's really the sole problem I found. Respect of my ancient zfs-root setup is far lighter and logging is fantastic as a protection against accidental overwrite. Of course it's not as powerful as hammer and it UI is even more raw, for instance to diff a tree or a file you have to manually:
- change relevant cp to an ss
- mount the ss to an arbitrary location
- diff live vol/snap against the other mounted
A thing that limit usefulness a bit but considering that in terms of performance and overhead can be compared to a non-buggy btrfs with the overhead of xfs/jfs... It's really worth it!
[1] you only need to use a custom iso, something super-easy on NixOS, mine is here http://ix.io/1wIQ the only really important part is
boot.supportedFilesystems = [ "nilfs2" ];
boot.initrd.kernelModules = [ "crc32" "nilfs2" ];
you may choose zfs, f2fs, bcachefs, ...[2] simply for grow resize first the LVM lv and after nilfs2, without dimension it grow the maximum free space available; for shrink shrink nilfs2 a bit more than the target size, resize the LVM lv to the new desired size, grow nilfs2 without dimension to occupy the entire LV free space. All operation are live, with mounted fs, it can't be resized otherwise!
[3] here http://ix.io/1wIS a really aggressive config, that on SSD essentially does not crate any noticeable overhead, on plate disk it make them spin regularly but it's just a matter of noise for desktop usage.
I remember that NILFS2 was in the middle order of magnitude in case of bugs from the presentation about filesystems fuzzing from 2016[0]. That certainly makes it more robust than BTRFS, but it's hard to compete against so much tested code like Ext4.
Time to first bug:
Ext4 2h BUG()
Xfs 1h45m Soft lockup
Gfs2 8m Double free
Ntfs 4m Soft lockup
Nilfs2 1m Page Fault
Hfs 30s Page Fault
Hfsplus 25s Page Fault
Reiserfs 25s BUG()
Ocfs2 15s BUG()
F2fs 10s BUG()
Btrfs 5s BUG()
[0] https://events.static.linuxfound.org/sites/events/files/slid...Generally speaking I prefer experience than testing, no matter how accurate they are, I can't really tell if nilfs2 is rock solid or not due to the too little experience I have, however it's an old (so patched enough) project by a Japan telco that I think use it internally so I feel a bit of trust, the rest is covered by a good and tested backup that can't be left apart in any case and with NixOS/GuixSD even a root fs crash is not a big issue since replicate it's only a matter of copy few (possibly one) text files and let the installer do it's business... So my main point is that nilfs2 it's far lighter than zfs, it's considered safe on GNU/Linux (zfs is not) and it offer a good protection against accidental overwrite/deletion that on a desktop is important for me, even with the best and quickest backup I can imaging... I've probably remained on zfs if nilfs2 was not in kernel officially supported since years but being already there, lightweight enough it's my default choice hoping/dreaming for a different future...
The rest of panorama is really bad:
- xfs is essentially dead, like jfs
- btrfs is a shitload of bugs
- zfs can't be integrated and it's considered not production-ready on GNU/Linux
- ext* are fs from another era, without nothing of the good things of xfs/jfs
- stratis is for now more a dubious dream and not a real solution, only a way to poorly circumvent actual sorry state of storage
- bcachefs is a promise, but for now it does not offer anything relevant
- f2fs have nice performance but it's a bit buggy IME and it's even more limited than nilfs2 to a point of being unuseful...
Outside of GNU/Linux IllumOS (despite it's zombie status) and FreeBSD have a good zfs support, production ready, DragonFlyBSD have hammer, the rest is as worse as Linux world...
Perhaps because HAMMER (+HAMMER2) is BSD licenced, it might have better potential as a Linux kernel module.
I also recommend trying out Bcachefs. It's developed on Debian so that's your best bet to give it a shot.
On license of course there is a problem but if we have zfs ported well... I think it can be circumvented, only I fear that in GNU/Linux land (especially -Linux part) there are too many people that do not consider at all modern needs, most of them are programmer's with no sysadmining background, they do not even understand why we desperately need new storage and "Big&Powerful" are absolutely happy because actual paleolithic storage solution means business opportunities... Remember Andrew Morton with it infamous "rampant layer violation" against zfs or NetApp that ask SUN "to unfree" zfs to avoid disrupting storage market...
IMO we have lost after Ubuntu ditch desktop the opportunity of a generic end-users GNU/Linux desktop and due to hw&sw evolution commercial-side we desperately need to innovate again as a FOSS community, DragonflyBSD is a very little substantial single-man-show project but it innovate, GNU keep innovate a bit despite a super-slow evolution and GuixSD is IMO the future of any OS, like it's "father" NixOS, the first IaC-builtin OSes in the world, but we need more, and with more manpower instead of wasting energy in evanescent crappy web-derived tech from GnomeShell extensions to Electron-based (cr)apps.
Storage in that sense is the basis since on storage we can design package managers and init systems, so in turn installers and in turn the rest of the OS. Having a modern, powerful storage, something like Plan9 propose years ago, something like Hammer, zfs, nilfs2, stratis etc are a thing that need to evolve and spread in GNU/Linux world or we can't really evolve...
It's a CoW filesystem, which should provide some inherent crash/power-fail safety that ext does not have (at least, as usually configured — and data logging has huge overhead).
On logging overhead... Well, yes and no, the logfs I tried do have overhead at garbage collection/cleaning but that overhead does not seems really important in practical terms. It demand a bit of careful design of storage layout and load prediction but nothing more than that.
I do not see practical advantage for most server usage however I see significant advantage for some server usage and certainly for desktop usage. Also potential future development is certainly interested... Imaging a package manager integrated with a logfs how effective can be only in terms of "immutable servers/IaC" applications, imaging how NixOS/GuixSD generations can easily and instantly switch, how can you deep and easily analyze datasets and systems...
Also overhead is there, a bit, today, but tomorrow can be significantly reduced if we have physical storage developed with logging in mind.