6

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 -

2
  • Can you give more details about what you're building and the hardware involved?
    – ewwhite
    Aug 24, 2016 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. Aug 25, 2016 at 15:37

4 Answers 4

4

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.

6
  • 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? Aug 25, 2016 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, 2016 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? Aug 25, 2016 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, 2016 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. Aug 27, 2016 at 14:33
3

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.

3
  • 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? Apr 1, 2017 at 8:33
  • 3
    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, 2017 at 8:48
  • 1
    Tom is making a very good point actually! Apr 1, 2017 at 10:58
1

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).

2
  • 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, 2016 at 12:34
  • I don't think it's worth the effort. Please use a standard filesystem for boot/root.
    – ewwhite
    Sep 15, 2016 at 12:35
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .