22

I am considering which OS and filesystem to use on some new servers I have and am considering either Free BSD with ZFS, or Linux with BTRFS.

The programs I have run on both systems, so the only issue is reliability of the filesystems and performance, etc.

Mark Henderson
  • 68,316
  • 31
  • 175
  • 255
yazz.com
  • 6,743
  • 14
  • 37
  • 38
  • 1
    I'm not much of a *nix person, but I usually see ZFS combined with Solaris - see this question here: http://serverfault.com/questions/60453/zfs-and-non-sun-oss (that might make your choice easier) – Mark Henderson Mar 30 '10 at 20:50
  • My personal choice would be zfs simply because I think it's a bit more mature than BTRFS. Of course I don't know how well zfs performs on bsd. – egorgry Mar 30 '10 at 20:58

7 Answers7

16

As of April 2010 Btrfs is still in development and not ready for production use (really, it isn't - I have been bitten experimenting with kernel 2.6.32). Feature-wise btrfs contains some but not all of ZFS features. Most notably RAID-Z and data deduplication are missing.

What does work with btrfs is snapshotting, copy-on-write, checksumming and using multiple disks as a single volume. GNU cp recently got a neat "reflink" function to copy files as copy-on-write duplicates.

ZFS-FUSE seems more stable than btrfs, so if you go with Linux that may be an option (http://zfs-fuse.net/). Most features of Solaris ZFS are implemented. Can't find up-to-date performance benchmarks, though.

For a rock solid solution, I'd still say go with Linux and XFS. If you need snapshotting, add LVM2. If you need Software-RAID, add mdadm.

Catskul
  • 1,839
  • 4
  • 20
  • 23
korkman
  • 1,647
  • 2
  • 13
  • 26
  • What's wrong with ZFS-FUSE on linux? I'm using that for my home NAS (2x500GB mirror setup with cron jobs for automatic snapshots and scrubbing) and I haven't had any problems. – Wim Coenen Mar 31 '10 at 14:32
  • I must admit after reading the latest updates on ZFS-FUSE it seems the project has successfully been revived (dev stalled for a long time). The feature-set is on par with ZFS on Solaris, only minor usability feats missing. I'll rephrase my answer accordingly. – korkman Apr 03 '10 at 01:24
  • 1
    ZFS can be used without FUSE it is already exists as native filesystem. See: http://zfsonlinux.org/ – Stone Feb 01 '12 at 20:25
  • "Please keep in mind the current 0.5.2 stable release does not yet support a mountable filesystem." – korkman Feb 22 '12 at 15:59
  • @korkman: [ZFS on Linux 0.6.1 is ready for wide scale deployment](https://groups.google.com/a/zfsonlinux.org/forum/?fromgroups=#!topic/zfs-announce/ZXADhyOwFfA) – Janus Troelsen Mar 29 '13 at 13:03
  • @Ysangkok: Thanks for the update, I'm actually using ZOL for quite some time now (RCs) and am impressed by the snapshot performance. Very good to have DKMS packages for Debian, I think I will deploy it on a few more systems. – korkman Apr 03 '13 at 12:57
6

As of today (2012-02-01) btrfs still lacks an fsck utility, meaning that all your data is at risk if your system crashes (think kernel panic, power loss, and many other scenarios). I've experienced this data loss first-hand. If you're looking for data security (and who isn't?) then avoid btrfs. As of right now BTRFS is for experimenting filesystem junkies or non-essential data.

Of course you should keep backups of valuable data anyways, right?

For an ultra-stable alternative use ZFS on PC/FreeBSD 9. ZFS is a trustworthy enterprise filesystem that's been around many years. RAIDZ2 is a life saver.

Fraser.Dk
  • 61
  • 1
  • 1
4

As others have mentioned, Btrfs is still experimental, so you probably don't want to rely on Btrfs just yet.

People generally seem happy with ZFS on BSD, but you might also want to consider running ZFS on Solaris.

The BSD port of ZFS is probably the most mature port, but it still lags a few versions behind ZFS on Solaris, so you won't get all the latest features right away. As of FreeBSD 8.0, only ZFS version 13 is supported--so, for example, you won't get deduplication (which was introduced in ZFS version 21). You also won't get iSCSI with FreeBSD 8.0.

If you want the latest ZFS features as they're introduced, you may want to opt for OpenSolaris or Oracle Solaris, or Nexenta (a Solaris derivative with a GNU userland).

rob
  • 1,253
  • 1
  • 10
  • 17
4

As others have already pointed out, BTRFS is not really production quality yet, so if you need something that works today, ZFS is a better bet.

For some background on BTRFS, and how it differs from ZFS, see this LWN article.

janneb
  • 3,761
  • 18
  • 22
4

I'm still a ZFS user (on both Solaris and Linux) however, on the latter, I would now consider btrfs as its latest (March 2012) release includes new features, performance improvements, bug fixes, and the very expected release of a btrfsfsck with repair capabilities.

According to that press release, the Btrfs file system is now production-ready.

jlliagre
  • 8,691
  • 16
  • 36
  • 1
    Unfortunately, Oracle appears to be the only Linux vendor who says btrfs is production ready. It seems a bit premature, but there are few choices for midsized systems which require large disks. The disks are getting so large that silent data corruption on a disk is inevitable, and fscking a 3TB volume is impractical. – Stefan Lasiewski Mar 28 '12 at 21:12
  • Oracle being btrfs main developer, it is no surprise for them to be the first vendor to support btrfs in production. Moreover, for most people, the lack of a working fsck was what preventing them to use btrfs. Finally, silent data corruption is unlikely to render a btrfs file system unmountable given the fact there are two checksummed copies of meta-data. According to the release notes, the suspected main cause of file system corruption was a cache flushing bug that has been fixed. – jlliagre Mar 29 '12 at 07:38
  • Agreed. There's more interesting discussion at http://serverfault.com/a/285909/36178 – Stefan Lasiewski Mar 29 '12 at 16:06
2

This question was asked almost a decade ago, but it still comes up in search engines, so it's probably worth adding an updated answer. ZFS on Linux is now fairly mature: Ubuntu added basic support in 2015 and in late 2019, added installation to a ZFS root. This means it is easier to compare ZFS and btrfs on the same OS, without turning this into a Linux vs FreeBSD discussion. (If you're not on Linux, btrfs is probably not an option.)

I've been using ZFS on a basic home Linux server for the last year with a few mirrored disks, and it works well. However, the need to install the ZFS kernel module complicates things somewhat compared to using btrfs, which is built into Linux. Booting from a ZFS root is not typical, and installing ZFS makes it harder to manage the frequent kernel updates in a rolling release distribution. I am using btrfs for some of my local storage, so I thought I would try to migrate my server to btrfs as well and solve all my problems with no external kernel modules.

ZFS is overall a more mature product. Setting up your first ZFS system is surprisingly easy: it seems like there should be more configuration required, but it's a "batteries included" filesystem. ZFS provides native support for encryption, whereas btrfs requires you to encrypt your own block device using dm-crypt or similar. ZFS can even take care of exporting your filesystem over NFS or SMB. ZFS's documentation is not pitched at a kernel hacker or casual user running a single boot disk (although ZFS can do this), but assumes that the reader is building a serious file server with users, redundancy and uptime.

In contrast, while btrfs is generally stable and many people have been using it happily for years, it still contains some dangerous features like the unstable RAID56 implementation, and its documentation is difficult to locate and understand. The overwhelming list of questions on the FAQ page is typical of the btrfs documentation experience. If your needs are simple, then you can probably safely ignore many of the warnings, but it will still take you longer to reach the level of understanding required to trust the filesystem. If you're still not sure what your needs are, btrfs makes it easier to change plans later, by adding or removing devices or resizing the filesystem while it is mounted.

ZFS and btrfs use the term snapshot in very different ways, which can be confusing at the initial stage of evaluating the two systems. While the two approaches are equally powerful, you may find one or the other more intuitive:

  • In ZFS, block devices form a zpool which can host an arbitrary number of mountable datasets. Each dataset may have a number of snapshots, which represent efficient copies of the state of that dataset at a particular time.

  • In btrfs, block devices form a filesystem which contains an arbitrary number of mountable subvolumes. A snapshot of a subvolume is itself another subvolume; "a snapshot is just like a (full) copy, except it's more economical because of the shared storage." The flexibility of this approach means you need to decide on some kind of layout convention if you want to use snapshots to manage incremental backups.

If you're considering both ZFS and btrfs on Linux, and you are interested in a more bleeding edge alternative, you could also look at bcachefs.

sjy
  • 207
  • 2
  • 8
1

While I was looking for the same thing I've stumbled over this piece of information from the FreeBSD wiki on the status of ZFS in FreeBSD. Looks like FreeBSD is catching up.

Source: http://wiki.freebsd.org/ZFSTuningGuide

History of FreeBSD releases with ZFS is as follows:

  • 7.0+ - original ZFS import, ZFS v6; requires significant tuning for stable operation (no longer supported)
  • 7.2 - still ZFS v6, improved memory handling, amd64 may need no memory tuning (no longer supported)
  • 7.3+ - backport of new ZFS v13 code, similar to the 8.0 code
  • 8.0 - new ZFS v13 code, lots of bug fixes - recommended over all past versions. (no longer supported)
  • 8.1+ - ZFS v14
  • 8.2+ - ZFS v15
  • 9.0+ - ZFS v28
magiconair
  • 111
  • 3