ZFS

From FnordWiki
Jump to navigation Jump to search

So ZFS is all shiny and stuff. We'll be using it for disk based storage of backups for the following reasons:

  • All data (and metadata) can be validated with cryptographically strong hashes
  • Data deduplication

Released versions of ZFSonLinux do not work on the kernels I'm running (3.12.x from backports.org), so I'm playing with zfs-fuse instead. [This is out of date. The ZFSonLinux packages have been working for a few months as this update is written.]

So, here's the first annoying thing I've come across. The ZFS tools go off and automatically mount filesystems in your just-created pool. And they go and make directories to mount those filesystems on. Quite annoying. What's wrong with putting entries in /etc/fstab and typing mkdir /foo? Instead zfs pool create solarissucksballs ... will create a /solarissucksballs directory on your machine and mount the new pool's filesystem there. ZFS on Solaris works this way, too. It's quite obnoxious.

Getting ZFSonLinux on Debian wheezy with backport kernels

Follow the directions at http://zfsonlinux.org/debian.html and bam, you're done.

Some useful tidbits

  • zfs set checksum=sha256 poolname # changes a filesystem's data integrity check algorithm from the default Fletcher4 to SHA256.
  • zfs set dedup=sha256,verify poolname # enable dedupe, use SHA256 hashes as keys, but also do a bit-by-bit comparison before deciding two blocks are the same
  • zfs set canmount=noauto poolname_OR_fsname # gets rid of the obnoxious /etc/fstab-less mounting behaviour at ZFS start time.
  • zfs set mountpoint=legacy poolname_OR_fsname # indicates that mounting based /etc/fstab entries is preferred for this one