ZFS: Z pretty File System

This week I had two disks fail. The first was the cheapest to fix, as it was in my 27″ iMac. I took the entire machine to the Apple Store and picked it up the next day. The failed disk was covered under AppleCare, restoring my data from Time Machine backups was effortless, and my total cost was $4 in gas and 1 hour of time.

The other failed disk was in my file server. The server had a mirrored pair of 1.5TB disks and a mirrored pair of 1.0TB disks. One of the latter exhibited pre-fail symptoms so I ordered a pair of 3TB disks to replace both pairs.

I removed one disk from each existing pair, inserted my new disks, created the new zpool, and then remembered why I like ZFS so much. Here are the commands required to initialize the new disks and copy everything to the new array:

zpool create zmirror3 mirror ada1 ada2
zfs snapshot -r tank@now
zfs send -Rv tank@now | zfs receive -Fvu zmirror3

That’s it. There’s a little housekeeping, like setting ‘zfs set mountpoint=none’ to prevent conflicts and cleaning up the snapshots, but that’s really it. By using ‘zfs send -R’, all the zfs pool and volume meta data gets transferred too. It seems too good to be true. Below are the verbose messages that are enabled with the -v flags included above.


receiving full stream of tank@now into zmirror3@now
receiving full stream of tank/root@now into zmirror3/root@now
received 1.31GB stream in 20 seconds (67.2MB/sec)
receiving full stream of tank/usr@now into zmirror3/usr@now
received 1007GB stream in 8625 seconds (120MB/sec)
receiving full stream of tank/snapshots@now into zmirror3/snapshots@now
received 456GB stream in 7487 seconds (62.4MB/sec)
receiving full stream of tank/swap@now into zmirror3/swap@now
received 34.6MB stream in 4 seconds (8.66MB/sec)
receiving full stream of tank/var@now into zmirror3/var@now
received 1.10GB stream in 34 seconds (33.2MB/sec)
storage#