I’ve seen people raving about OpenSolaris and in particular ZFS and thought, “must try that one day”, then seen that there are licensing issues and never really got around to it. Then recently I was attracted by BTRFS, which has lots of nice features, so I thought I’d give it a try. Unfortunately BTRFS is about as stable at a 10ft Jelly in a high wind and is more full of feature holes than the proverbial cheese made in Switzerland.
So, ZFS is sort of like BTRFS, but it’s stable and had all the features BTRFS would like to have … yes?
You’re waiting for me to say “actually, no!” … however, actually “yes” !
It does have a few shortcomings, but essentially it IS the best thing since sliced bread and if you’re not running your server on it, one day you won’t just be kicking yourself, you’ll be kicking yourself around the room, out the door, and down the street! Too strong a recommendation? Try it yourself!
To install, do this; (on Ubuntu)
sudo add-apt-repository ppa:zfs-native/stable
apt-get update && apt-get install ubuntu-zfs
If you have two available disks, create a raid10 like this;
zpool create vols mirror /dev/sda /dev/sdb # modify device names as appropriate
It will create the mount points and mount the filesystems for you.
If you have a bunch of disks, create a raidz array (Raid5 without the bugs) with two parity disks like this;
zpool create vols raidz2 /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf
I think in general you’ll find these RAID’s perform “better” than the traditional Linux RAID, and has many other features.
(just for kick off, RAID’s are all striped, so you’re going to get 500M/sec+ off of 6 disks!)
You can create subvolumes like this;
zfs create vols/home
zfs create vols/backups
And here comes the really good stuff, you can create snapshots like this;
zfs snapshot vols/home@fullback
You can then send a snapshot to another volume, so for example;
zfs send vols/home@fullback | zfs receive -f vols/backups
And, wait for it, to make a backup on a remote system, assuming it too runs ZFS;
zfs send vols/home@fullback | ssh root@remote zfs receive -d vols/backups
And (!) the icing on the cake, you can also do incremental backups, so following from the above example;
zfs snapshot vols/home@incremental
zfs send -i vols/home@fullback vols/home@incremental | ssh root@remote receive -d vols/backups
… which sends the differences between the two snapshots to the remote host, then on the remote host creates a new snapshot and merges the changes into it’s copy of vols/home. i.e. the remote host will have the latest copy of your volume, which it automatically creates and mounts, and it will have a snapshot to match each incremental backup you’ve made. Indeed incremental’s are so quick, running one per minute is more than realistic!
Think about it, a full backup of your system, every minute! And it even works on VM image files! No more “rsync” !!
You can read the spec’s, and there are some gotcha’s, but once you’ve worked your way through everything, it’s an incredibly powerful alternative if you’re not too worried about the theoretical licensing restrictions (!)