Alex headshot

AlBlue’s Blog

Macs, Modularity and More

Saved by ZFS (twice)

2009, mac, zfs

Saddened as I am with zfs' departure from Snow Leopard, I still use it for my day-to-day fileserving needs (and if ZFS isn't available in the future, then I'm quite happy in not upgrading my server just yet). It's come to my aid in a couple of ways recently which are worth mentioning in praise.

A few weeks ago, owing to an NFS networking problem, my login.keychain suddenly disappeared. I have no idea particularly why, only that when I logged in one day I discovered that all my passwords and personal secure data had disappeared. Now, had I not had the luxury of backups or something like Time Machine to be able to reacquire the data, I'd have been stumped. Fortunately, I have an automated ZFS snapshot job running which allows me to generate a list of snapshots on an hourly, daily, and weekly basis. Unfortunately, the .zfs support isn't available in ZFS-119, but I can still mount one of my previous snapshots (using zfs clone) and then peruse the contents of my filesystem hours or days into the past. All I needed to do was copy the contents of the previous file from last night's daily backup, and I'm good to go again.

The second time was over the weekend, when I came down to hear my file server performing the click of death. I bought a Iomega Ultramax almost exactly a year ago (14 months, in fact) and the Segate Barracuda 7200.10 inside was making some strange noises. The disk wouldn't mount, and therefore the pool was off-line. Now, I've had some issues with the Iomega before (like not powering on after a power failure and being noisier than a leaf blower in a library) but I've given it the benefit of the doubt. And in any case, I had mirrored the drives, so that if one failed, then the other would still be available.

Unfortunately, the single point of failure was the Iomega unit itself. For whatever reason, it wasn't happy with the Seagate and was executing the clicks (possibly after a self-contained timer has said "the warranty has run out"). I bought an external SATA adapter from Maplin (actually, good quality) and hooked up the internal drives; both checked out OK although I think one was on the way out. Fortunately, either drive was mountable by ZFS although ZFS was helpfully indicating that one of them was starting to suffer from checksum errors (go ZFS!).

Long story short; I had to buy some more hard drives. This time, instead of going for a fan-assisted needs-a-separate-power-unit job, I plumped for a couple of bus-powered 2.5" devices. These work on either USB or Firewire (with my preferred way being Firewire) and have the advantage that they come on with the machine and off with it. So if there's a power failure in the future, my pool will come back up with the system.

Moving data across was a doddle; having mounted one drive in the pool, ZFS noted that the pool was still operational but with degraded capability. All I needed to do was execute zpool replace Pool oldDisk newDisk and it set about reslivering the disks. A few hours later, and it was time to execute zpool replace Pool workingDisk newOtherDisk and my pool is now running on 2009 disks, which hopefully have a longer shelf life than the other ones. Oh, and did I mention? ZFS doesn't care that they're the same size. It just cares that it has enough space to be able to punt the data from one to another. In fact, if I'd wanted to make my pool bigger at this point, I would have been able to replace them with larger disks, and it would work (actually, I replaced them with the same size owing to what I could get my hands on late on a Sunday afternoon). Alternatively, I could add more spindles to the pool which would make up for the slower rotational speed of the 2.5" disks.

So, ZFS has come to my rescue twice this month. It's a real shame that we won't see it by default in Snow Leopard, but hopefully it's been moved sideways rather than ejected completely, and we'll see new binaries coming out after Snow Leopard has hit the shelves.