08 tra 2013, 11:17
With ZFS support on Linux reaching a new milestone which is the better choice for Linux users, Btrfs or ZFS? Why might I choose one over the other?
A good deal of what separates the two file systems, Btrfs and ZFS, has less to do with technical merit and more to do with communities and licensing. I suspect many people make their decision as to which file system technology to use based on which community they are in rather than the benefits of using one advanced file system or the other. Which isn't to say the choice is entirely political, but rather different communities will have better (or worse) support for one technology or the other.
ZFS first appeared in OpenSolaris back in 2005 and was licensed under the Common Development and Distribution License (CDDL). This fairly liberal licensing allowed ZFS technology to spread from OpenSolaris to FreeBSD, OS X, PC-BSD, FreeNAS, NetBSD, OpenIndiana and other liberally licensed operating systems. The technology has had seven years to mature, developers have had time to shake out the bugs and just about anywhere you go in the Solaris/BSD communities you can find ZFS support and documentation. However, ZFS support hasn't gained as much of a foothold in Linux circles because the CDDL, under which ZFS is licensed, isn't entirely compatible with the GNU General Public License (GPL) which is used by the Linux kernel. This means the source code for ZFS cannot be merged with the Linux kernel and distributed. Instead Linux distributions need to find another way to support ZFS, either using add-on kernel modules (as supplied by the ZFS on Linux project) or they can supply a ZFS userspace driver. Neither solution is ideal and it tends to make Linux administrators uneasy about adopting ZFS.
Btrfs, on the other hand, was developed specifically to work with Linux and is licensed under the GNU General Public License. Both the origin of Btrfs and its license suggest it is unlikely to see wide spread usage outside of the Linux communities. At the same time the fact that Btrfs was designed to work specifically with the Linux kernel meant that it could be adopted into the Linux source code early on in its development and lots of people have been able to work on Btrfs without worrying about changes to the kernel's interfaces which might cause incompatibilities. Having Btrfs built into the kernel makes it a more attractive file system for Linux distributions which means we are more likely to find support for Btrfs in Linux installers and in the documentation of various distributions. One of the few drawbacks to adopting Btrfs on Linux at this stage is Btrfs is still fairly young. The technology was introduced into the Linux kernel in 2009 and the code is still under "heavy development", which means it's risky to use Btrfs on production systems. Choosing to use either ZFS or Btrfs on Linux carries a small amount of risk as ZFS is rarely given official support by distributions and Btrfs is still developing fast enough most distributions aren't ready to treat it as a first-class file system.
On the technical side of things both Btrfs and ZFS have a good deal in common. They both allow administrators to manage huge amounts of data spread out across multiple storage devices. Both file systems allow for snapshots, restores and transferring the complex file system to another machine. For many people the features offered by either file system will be suitable. There are some differences which may tip the balance in favour of one technology or the other. For instance Btrfs is compatible with the ext4 family of file systems. This means we can convert an ext4 file system to Btrfs and then convert Btrfs back to ext4. This makes it easy to experiment with Btrfs or grow a Btrfs implementation out of an existing Linux installation. As mentioned earlier ZFS has gained widespread usage on other platforms and administrators should be able to export ZFS pools from other operating systems to Linux or from Linux to another operating system, which can be convenient. Btrfs has a really nice "diff" feature which allows users to compare the contents of a file as it currently exists against the contents of a previous version of the file. This is especially ideal for developers as they can track changes to code or documentation using the file system's snapshots. In my opinion the ZFS command line utilities have a nicer syntax and I find the manual pages easier to read.
I think the issue of which technology to use comes down to this question: Do you want to use a file system which has been around long enough to become stable and work consistently across multiple operating systems, or do you want a younger technology which is specific to Linux and will likely receive support from your distribution? Personally I would recommend trying both file systems on a test machine, load them up with data, make snapshots, perform restores, intentionally attempt to corrupt the data and then try to rescue the file system. See which technology you feel is best suited to your situation.
08 tra 2013, 13:30
09 tra 2013, 19:52
10 tra 2013, 10:03
10 tra 2013, 12:09