2

It seems ZFS is much more robust than ext4, specially for handling power failures or bad-blocks/media-corruption.

There's old literature from 2013, 2014... here and there about ZFS as a boot filesystem...

My old SoHo server is starting to give me bad-blocks and I plan to replace it with new hardware. I'll be virtualizing things on it, both in VirtualBox and in docker. VirtualBox images are aimed to be "progressively converted" to docker images and then remove VirtualBox and go only with dockers.

But time elapses. We are on 2020 now.

My concern is about storage. The filesystem for the whole SoHo server.

I've seen ZFS has tons of configurations for redundancy. In the case for a SOHO server, I'd bet for "at least" two phisical drives, but also IDK if that's the way to go.

This is not a NAS-only server. It'll be serving firewalling/routing, it's also serving a web-server for development, an IMAP server, MySQL, and other things. All them are virtualized on the main OS. So it's not "a NAS", it's a full SoHo server.

Questions

  1. Is it a good idea to have ZFS as the boot filesystem for a SOHO server?
  2. Why ubuntu and other distros are still offering ext4 instead zfs as the default?
  3. In case it is a good idea, what's the proper way to set it up?
  4. Any "configuration recipe"?
Xavi Montero
  • 523
  • 6
  • 19

3 Answers3

1

1) ZFS is always a good idea, for everything. I have used it for everything except /boot/efi, and in some cases /boot for years. All of my servers are in ZFS rootfs.

2) Because of inertia and people's preference for "familiar" over "good". I've been using ZFS in everything since before ZFSonLinux had POSIX support (original version with POSIX FS support came from KQ Infotech, before it ZoL had a working port). It has been a period of a massive reduction of my need to restore anything from backups.

3/4) This is still accurate: https://github.com/openzfs/zfs/wiki/Ubuntu-18.04-Root-on-ZFS

Gordan Bobić
  • 3,330
  • 1
  • 18
  • 23
0

Generally, I'd recommend ZFS only for lab server or if you have experience handling ZFS features. Long story short: due to fact that ext2,3,4 filesystem used more often, it will me much more convenient.

  • bug tracking will be enforced more rapidly;
  • there are a lot more people who know how to work with it if advise needed;
  • You can easily transform ext4 to ext2, say if you want it on SSD in future. Which is not a problem if you copy data, but still;
  • There is a large amount of recovery tools for ext4;

Again, for purposes of server that should "just work", and doesn't have underlying storage system, I would not recommend Zettabyte FileSystem :)

  • Do you have big data volume? I guess not;
  • Do you use LVM? Unlikely;
  • What does dynamic block size gives you? Mostly nothing on one disk.

Bottom line: If you want to play with zfs, just add one more disk to server and dump there "not so important" data. When competence grows, you could decide yourself if you want to keep zfs. For / I recommend ext4 in any case.

Here's performance comparison.

geoai777
  • 146
  • 7
  • 1
    Those performance tests are hardly indicative of real world performance. For example, why would you use anything other than sync=disabled for a compile backing file system? With appropriate tuning, ZFS will go faster than the traditional stack in virtually all cases. – Gordan Bobić May 04 '20 at 15:55
  • Thank you for sharing experience. Could you please advise zfs maintenance tools for disk check and file recovery (for example accidentally deleted). It's most common tasks that are needed on FS. Thank you in advance. – geoai777 May 04 '20 at 16:13
  • Diet version: use sanoid for regular snapshotting, and always use some kind of disk redundancy (mirroring, RAIDZn). Schedule a `zfs scrub` once a month (in addition to regular smartd disk checks). That is all you will regularly need, and virtually all of it should be automated. `.zfs` invisible directory is _really_ handy for grabbing a file out of an older snapshot without having to clone/mount a snapshot. In terms of disk check and recovery, due to the transactional nature of ZFS importing a pool effectively does the equivalent of most of what fsck does on a regular file system. – Gordan Bobić May 04 '20 at 16:31
  • As I get it, the idea behind snapshots is pretty much the same as with vmware snapshots. I.e. we copy part of FAT table and use references to make it appear like data is written/deleted, when in fact data is written in another location and deleted only from FAT copy. This approach has one disadvantage: it consumes additional space every write operation. Which is mostly fine. It would be funny to integrate zfs with docker. – geoai777 May 04 '20 at 17:00
  • With a Copy-on-Write file system where nothing is ever overwritten in place, snapshotting is completely free in terms of overheads, regardless of how many snapshots you have. In fact, snapshots can _reduce_ the write I/O because the deallocation of a block that exists in a snapshot doesn't happen until you delete the snapshot. Docker already supports zfs natively and has done for years. – Gordan Bobić May 04 '20 at 17:30
  • Are there recommendations on space quotas for SoHo servers? It is pretty luxurious to keep 200Gb free of 1TB hdd just for performance. Also I have a feeling, that ZFS is better with RAID than on single disk. I mean it really should be on RAID, at least on mirror. – geoai777 May 08 '20 at 11:48
  • ZFS is better on a single disk as well. At least it will tell you when your single disk is silently corrupting the data - other file systems will happily feed you back the corrupted data as if everything is fine. And any data that is of any importance should always be on redundant storage and backed up. You don't need to keep 200GB empty on a 1TB disk, that was never the case, the 20% figure comes from the early days of ZFS when disks sizes were GBs rather than TBs, and with the newer features like spacemaps the performance degradation from space exhaustion have been pushed much further out. – Gordan Bobić May 08 '20 at 12:12
0

Why ubuntu and other distros are still offering ext4 instead zfs as the default

ZFS has some licensing uncertainty re: kernel (GPL) so most distributions do not ship it as a default option. It can be complex to set up and use as well so is not a good default choice for a distro although as others have said it is probably the most feature rich and resilient filesystem available.

In case it is a good idea, what's the proper way to set it up?

Any "configuration recipe"?

https://zfsonlinux.org/

Peleion
  • 789
  • 6
  • 8