ZFS Automatic Backup 0.1
I finished the first version of the ZFS Automatic Backup Service that I mentioned a while back.
You can download the zfs-automatic-backup-0.1.tar.gz package, which contains this README.zfs-auto-backup.txt documentation.
The intent here, is to be able to automatically backup selected ZFS filesystems on your machine whenever a named USB volume is plugged into your system. The target audience here is developers & users of small systems who want a small safeguard against their machine being lost or damaged - a little more peace of mind in the face of a heartless world.
It's pretty easy to setup - just copy the files to the right place, import the SMF manifest, and configure the name of the volume you want to backup to. Then use "zfs set com.sun:auto-backup=true <name of dataset>" to mark filesystems for backup.
On plugging the USB disk into the machine, the service takes a snapshot of the filesystems marked for backup, checks for the presence of an existing backup on the storage media, and kicks off either a full or incremental zfs send to the USB disk, depending on whether it finds a previous snapshot saved to the disk or whether you've explicitly asked for full backups all the time. More info in the README.
Here's a few screenshots showing what appears on your desktop whenever you plug the configured USB disk into your machine (at the start, and end of the backup):
(zooming in on one of the above images)
The GUI notification is a bit hairy, an SMF service running as root writing something to the desktop session of a logged-in user, so apologies for that in advance (no, there's no multi-seat support, yes this is a terrible hack). Walking the line between "annoying pop-ups" and "not enough information" is difficult, I admit - so let me know what you think. There's a problem with text wrapping in the notification box - haven't yet investigated that.
I've tested this on small numbers of small filesystems, but it should scale to multiple-gigabytes of backups, assuming there's no bugs in my code (I was testing all this on a USB 1.0 card reader, so waiting around for gigabytes of data to copy wasn't an option :-)
Once again, many thanks to pjd for the "ZFS Man" image. All comments, and especially bug reports would be great!
Hello,
this looks good :-)
(and i hadn't seen the Zuperman sign before)
I won't have time to test in the near future, so how do you handle an interrupted backup? Do you cancel it, or try to somehow resume it the next time it is connected?
For the popup, I think it is a good idea, but I guess it would need to be configurable so it can be either completely disabled or disappear automatically after 5 seconds or stay, or maybe even an option that asks before starting the backup? UI is often the hardest part of any project... And here the confusion between root and the user logged on console only makes it harder. Maybe this should require the user to have "backup rights" on the filesystem?
Posted by Marc on October 01, 2007 at 05:55 PM IST #
Thanks Marc. Nope, you won't be able to eject a disk mid-backup - Solaris should take care of that by keeping the device busy during the backup.
If the backup wasn't completed correctly, then a temporary file will be left dangling on the disk, overwritten the next time you try to backup to the disk, so no harm done - a new backup will be initiated the next time we see the volume (either incremental from the last good saved backup, or a full backup)
For now, the popup (created by notify-send(1) stays there for 10 seconds, which I figured would be enough)
You're right there's a security risk with unknown users being able to insert named USB disks into a machine and pull data off the system, but if you're not securing your physical machine appropriately, then this isn't much worse than giving them a screwdriver and inviting them to dig out your hard disk!
Posted by Tim Foster on October 01, 2007 at 06:05 PM IST #
With the bonjour-stuff and d-bus one should be able to take the laptop home / into the office, see the central backup-server appear and start the backup via net. This would be a slight modification at the discovery and the transport-level. But how to do the authentication-stuff (NFSv4, SSH-keying, others?) ?
Posted by Thomas Wagner on October 01, 2007 at 06:36 PM IST #
Hey Thomas - yep, as I alluded to before (see comments to my previous post) I think there's enough hooks to make this possible with Network AutoMagic. Ssh keys for authentication would be good, but also zfs-crypto on any ZFS streams that are network-facing I think would also be prudent.
Posted by Tim Foster on October 01, 2007 at 07:19 PM IST #
It's great that people are beginning to expose this sort of power to the desktop. If we could get some sort of backup administration tool gui set up in the gnome desktop to configurte this we'd be way ahead of the OSX, Linux and Windows crowd on backup automation for end users...
Great work on this Tim...do we have access to Zuperman logo as well, it looks pretty cool!
Posted by Ché Kristo on October 02, 2007 at 03:01 AM IST #
Thanks Ché. There's not much configuring needed - I'm sure a simple zenity script would do it (although my learning pygtk would probably help)! Pawel's ZFS-Man logos are at http://be.unnameden.com/zfs.shirt/ .
Posted by Tim Foster on October 02, 2007 at 10:14 AM IST #
Need to remove the logo from the above (although I still think it's cool :-)
Posted by Tim Foster on October 16, 2007 at 08:23 PM IST #
"Need to remove the logo from the above"
Is there any reason you need to remove it???
Posted by Ché Kristo on October 18, 2007 at 03:49 AM IST #
Yeah - not allowed use those icons. Anyway, new version now available at
http://blogs.sun.com/timf/entry/zfs_automatic_for_the_people
Posted by Tim Foster on November 07, 2007 at 05:23 PM GMT #