Beep Beep Beep

I use ZFS, and I love it, I think it is the best filesystem out there. It's primary focus is on integrity, which is the most important thing. What is also important, backups. Even with the data integrity that ZFS offers (which far surpasses any hardware RAID), you still have to backup.

Again, with ZFS, this is much easier than with other solutions (like Bacula for example). Since we run Sun servers, we also run Solaris, since when you run Solaris on Sun hardware, the licence is relatively cheap. As a result, I use the Timeslider service to automatically create snapshots (which, when you share a ZFS filesystem out via CIFS shows up in the Windows GUI as "previous versions").

Because of this, I also use the "zfs-send" plugin, basically backing up snapshots to a separate Solaris server. However, there are some gotchas which may catch you out if you had a working config, and then change things around and find the zfs-send service failing.

First, zfs-send will put a hold on snapshots. It does this so they don't get deleted before they're used to send to the remote server. However, if you're in the situation where you need to clear all the snapshots (for example, you've moved, or changed zfs filesystems you want to backup). Then you will find you can't delete these, what you have to do is "zfs release" the snapshots.

Here is a little snippet that will do this (and delete ALL zfs-auto-snap snapshots on the system):

for snap in `zfs list -H -o name -t snapshot | grep @zfs-auto-snap`;
do zfs release org.opensolaris:time-slider-plugin:zfs-send $snap;
   zfs destroy $snap;

Then, secondly, zfs-send stores the name of the previously sent snapshot as a property on the filesystem. It does this, so it knows it can use an incremental zfs send. However, if you have broken this sequence, or deleted the snapshots, then this will cause it to break.

You can look for it with:

zfs get -r org.opensolaris:time-slider-plugin:zfs-send storage

Where "storage" can be replaced with your particular zpool name. To clear a property, you use "zfs inherit", like so:

zfs inherit org.opensolaris:time-slider-plugin:zfs-send storage/shares

Changing "storage/shares" to the particular ZFS file system you want to clear the property from. You can clear this property recursively by just adding the "-r" option:

zfs inherit -r org.opensolaris:time-slider-plugin:zfs-send storage/shares

Once you've done this, just enable the service (or clear it if it was forced into maintenance) and you should be golden.