I am new to Linux and will be building a storage server using either Ubuntu or Debian (haven't decided which, yet). I will be installing ZFS as the storage file system. What I need help with is choosing the Linux boot filesystem, which from my reading is the same thing as the root filesystem (please correct me if I'm wrong about this).

What I'd like to know from the community is whether or not using ZFS as both my storage filesystem and my boot/root filesystem is a good idea? I've read posts saying that ext4 is mature and battle-tested and that this is the filesystem that should be used to boot Linux. I also see a ton of posts asking about building new Linux machines using ZFS as the Linux boot filesystem. What are the risks for using ZFS instead of ext4 as the boot/root filesystem, if any?

Thanks In Advance For Your Help -

  • Can you give more details about what you're building and the hardware involved? – ewwhite Aug 24 '16 at 13:33
  • Sure. I'm building a continuous integration/development/deployment infrastructure. I want this infrastructure to mirror my production environment which will be a classic SaaS setup with load balancers, Web servers, database servers, and storage servers. I want everything automated using Ansible and Vagrant that manages LXD/LXC O/S containers, KVM (for Windows environments that require a Virtual Machine), and Docker app containers. – Bill Vallance Aug 25 '16 at 15:37
up vote 4 down vote accepted

I would not use ZFS as boot/root filesystem. For basic system setup, I would go with very well tested and fully integrated filesystems.

ZoL is awesome, but booting from it, or using it as root filesystem, can have some unexpected behavior with no real benefit. On the other hand, it is an excellent filesystem for your data/storage partition.

EDIT: from your comments it appears you don't know ZFS command line. Please stop here immediately: using a tool without understanding how it works is a recipe for disaster. Please only use filesystem whose tools you know, or documents yourself on ZFS before putting it in any use.

  • Thanks for the response. If I use ext4 as my boot O/S filesystem, then I'm assuming I need to backup the boot O/S using a tool other than ZFS, correct? – Bill Vallance Aug 25 '16 at 15:29
  • Surely you can not use ZFS send/receive, but many other tools exist, both at application leve (rsync, tar, ecc) and filesystem level (dump, xfsdump, ecc) – shodanshok Aug 25 '16 at 20:53
  • I'm new to ZFS, too. I understand the features, but not the commands - yet. I take your answer to mean "No, you can't use ZFS to backup the boot O/S." Is this correct? – Bill Vallance Aug 25 '16 at 23:28
  • 1
    If your root OS is not ZFS based, clearly you can't use ZFS utilities to backup it. However, if you don't know ZFS command line, please stop here immediately: using a tool without understanding how it works is a recipe for disaster. – shodanshok Aug 26 '16 at 8:11
  • My question clearly states that "I'm new to Linux." That means ZFS, too. That's why I'm asking the community if I should use ZFS as a boot filesystem because I have no clue if I should or not. I'm in the process of specifying hardware for my continuous integration infrastructure and I need to address the issue of boot O/S disaster recovery. What I specify for the boot system hardware is dependent upon whether or not I should use ZFS as the boot filesystem. Thanks for your time - what I hear you saying is DON'T use ZFS for the boot filesystem. – Bill Vallance Aug 27 '16 at 14:33

Don't use ZFS root.

If you're building a storage server, treat the storage separate from the OS. Generic ext4 or XFS is fine for the OS.

I'd also consider a RHEL or CentOS variant instead of Debian for ZFS. But that's preference (and battle experience).

  • These instructions seem quit straight forward and don't mention any downsides or warnings, am I really asking for trouble if I set up my new computer in this way? I've had secondary HDDs and SSDs running on ZoL (Ubuntu 12.04) for a few years now. – NikoNyrh Sep 15 '16 at 12:34
  • I don't think it's worth the effort. Please use a standard filesystem for boot/root. – ewwhite Sep 15 '16 at 12:35

I am using zfs as a root file system for ubuntu 14.04, both in single disk and in a mirror. I have three clones. No problem whatsoever: transparent compression, instant snapshots, incremental backups, data correction (in mirror) etc, etc.

The above comments seem that they don't know anything about ZFS on Linux (ZoL) and/or Linux.

  • Since most of the other comments seem to be on the side of 'use ZFS on anything except your root partition', is there anything that running your host with a ZFS root brings you - or some specific functionality that is useful for a root/boot disk? – iwaseatenbyagrue Apr 1 '17 at 8:33
  • 2
    In Solaris and its open source offspring, ZFS root is tightly integrated into the package system, using snapshots and clones to provide a very nice and safe upgrade path in the form of alternate boot environments. You could probably achieve something similar on Linux, albeit not as polished. My feeling is if you're new to ZFS it would probably add more risk and complexity than it would help. – Tom Shaw Apr 1 '17 at 8:48
  • 1
    Tom is making a very good point actually! – BaronSamedi1958 Apr 1 '17 at 10:58

The main advantage I see for using ZFS:

  1. Data integrity.

  2. Snapshots. If you update your system and break something, you can roll back.

  3. Compatibility with other operating systems. ZFS support seems to be available on all major OSes.

  4. Adding disks. One can easily add more disks.

  5. Easier partitioning.

  6. Better backups.

Downsides

  1. Rescue disks are hard to come by.

  2. Support is "experimental" so you're less likely to get help if you need it. (Read comments above).

  3. Installation is more difficult.

  4. It's easier to brick your system if you update. I have had issues with new kernels mismatched between SPL/ZFS versions which broke ZFS support. There are a lot of moving parts that all need to be kept in sync.

I'd suggest using the default filesystem, if you're new to Linux, and installing ZFS on another whole drive. This could be a thumb drive, if necessary. Practice creating and deleting pools, snapshots, and rolling back.

Also, practice installing Linux into an ext4 chroot as this skill seems to still be necessary to get ZFS working. Once you have all this going, you're in a better position to tackle ZFS on root.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.