ZFS on YOUR Desktop
I spent a bit of a time few weeks ago thinking about how ZFS could play a role on the Solaris desktop.
In particular, I think ZFS snapshots would be really great for the desktop user.
ZFS snapshots, if you're not familiar with them, allow you to save the state of the files and directories on your filesystem at any given moment. They take up no additional disk space, and are created in an instant. At any time, you can visit all of the files that existed at the time you took the snapshot, allowing you to peer into the past (and perhaps recover an older copy of that file that you might have deleted by mistake)
We don't yet have much desktop integration for ZFS though: we do offer an excellent command line user interface and the web-based ZFS Adminstration GUI - while both are very capable, neither are aimed at the casual desktop end-user.
Well, here's what I think the future looks like:
In this image, you can see a folder called "Documents" open on the desktop. I've just hit a hotkey, which has made that folder tilt backwards a little, and all of those slightly faded folders behind it have telescoped out into the distance - each corresponds to a folder in a snapshot of that filesystem that I've taken in the past. You can also see that files which differ between snapshots have been shaded different colours. We still need to write code to label each snapshot window, and come up with a nice way to toggle between the windows, but then we're done ! (although I'm not sure how well this would scale with many snapshots - perhaps older snapshots could be reduced in size..)
Of course, that screenshot was faked, but with technology like Looking Glass 3D, the future probably isn't that far away.
I'm impatient though, so I wanted to bring the future a little
closer :-) I wrote some quite simple ZFS integration for
Nautilus, the GNOME File Manager, which you can try on Solaris
today!
Just download and extract
this tarball to your home directory, then navigate to any folder
on a ZFS filesystem in the GNOME File Manager. Right click
in that window, and choose the scripts menu entry,
you'll then see four new menu options:
- ZFS: Open snapshots (which corresponds to the screenshot below)
- ZFS: Take a snapshot
- ZFS: List snapshots (which also allows you to open a single snapshot)
- ZFS: Destroy a snapshot
Here's what it looks like in action:
Of course, if you try running those commands on a non-ZFS filesystem, the system will report an error message.
You will need
the ZFS File System Management profile in order
to use some of those features, specifically the "Take a snapshot"
and "Destroy a snapshot" commands - you can add that
profile using:
usermod -P "ZFS File System Management" [your username](you may need to log out and log back in for the changes to apply)
While thinking about ZFS on the desktop, I realised there's a few
other things that we may need in order to get really nice desktop
integration (apart from a C implementation of the ideas above! Shell
scripts are nice for prototyping, but they're a bit slow..) In
particular, I haven't implemented the zfs rollback
functionality, allowing you to instantly revert your filesystem to a
saved snapshot.
At the moment, in order to rollback to a snapshot, we need to unmount the filesystem first, which is difficult if you have it open in a file manager window. I've logged RFE 6421210 about that. Also, if your home directory actually resides on an NFS-shared directory, you don't get to use ZFS in all it's glory (though of course, you do get to take advantage of it's performance & stability, and your friendly neighbourhood sysadmin can now sleep at night) - all the same, I logged RFE 6421209.
We'd be interested in hearing what you think about this, so all comments are welcome - do you think this would be useful ?
I'm already finding ZFS snapshots wonderful, here's hoping this sort of GUI integration will find it's way onto everybody's desktop! And if you thought Solaris was just for servers, then you probably need to get up to date!
Note: As you can probably tell from the dates on the screenshots,
I wrote this a while back, but just wanted to pass the idea around a few
folks in Sun before I posted this. In the meantime, there's been an
interesting discussion on opensolaris-discuss about
this very topic! Well, how's this for ZFS desktop integration guys ?!
Update 8th August 2006: So, Apple it seems has just announced something awfully similar to the ideas I mentioned here - check out Time Machine. Do I get an ice-cream for doing this before them ? :-)
Update 16th August 2006: Updated the tarball above to fix a problem with the "ZFS: Open Snapshots" command when in a folder that contains other ZFS filesystems. We now open only snapshots for that filesystem, not snapshots of child filesystems of that filesystem.
Posted by James McPherson on May 23, 2006 at 02:05 PM IST #
Additionally, I suggest having this feature added to a tab in the file attribute box of the Gnome file manager and optionally having the restore option to overwrite in place, or elsewhere on the file system, the regurgitated snapshot data.
For the casual desktop user, this would be simplest IMHO for the one factor it would be one place a phone tech support person could go to and help the end user without having multiple windows and colored files - especially difficult for colorblind or visually impaired users.
Posted by Wes Williams on May 23, 2006 at 02:06 PM IST #
A friend of mine, Sandeep Ranade, built a UI for a filesystem with similar snapshot functionality to ZFS: Time-travelling File Manager. It's not as pretty as the 3d concept, and it uses KDE rather than Gnome, but it would be fairly trivial to modify it for use with ZFS.
Can ordinary user accounts create ZFS snapshots though? It looks like they'd need PRIV_SYS_MOUNT.
Posted by Eric Northup on May 23, 2006 at 02:15 PM IST #
Thanks James! Good points all, Wes - you're right that this doesn't take into account the needs of disabled users. I like the idea of a file properties tab to show snapshots of a file, but would like to (somehow) be able to show that files from various snapshots are different - perhaps mark them with a * ? I guess we'd also need 6425091 for that... (you could hack together something with diff, but just asking ZFS would seem so much more efficient)
Posted by Tim Foster on May 23, 2006 at 02:16 PM IST #
Posted by Tim Foster on May 23, 2006 at 02:19 PM IST #
Posted by James Dickens on May 23, 2006 at 05:42 PM IST #
Posted by Tim Foster on May 23, 2006 at 05:56 PM IST #
Posted by Jacob on May 24, 2006 at 09:09 PM IST #
Posted by Tim Foster on May 24, 2006 at 10:09 PM IST #
Posted by Juan de Dios Santander Vela on August 08, 2006 at 06:44 PM IST #
This post from Adam suggests that at the moment, it isn't ZFS - however, it wouldn't surprise me if a port of ZFS to Mac OS X was one of the "big surprises" Steve mentioned in the keynote. (again, I'm just theorising here, I don't have any concrete proof)
Posted by Tim Foster on August 08, 2006 at 07:29 PM IST #
Posted by Alexander on August 09, 2006 at 05:04 PM IST #
Posted by Juan de Dios Santander Vela on January 09, 2007 at 12:20 PM GMT #
Update: of course, these days, you can use the ZFS delgated administration facility, to allow users access to create snapshots without needing RBAC. More in Mark's post http://blogs.sun.com/marks/entry/zfs_delegated_administration
Posted by Tim Foster on September 06, 2007 at 02:42 PM IST #
Update: Erwann posted some screenshots that does just this!
http://blogs.sun.com/timf/en_IE/entry/zfs_on_your_desktop_screenshots
Posted by Tim Foster on October 14, 2008 at 10:58 AM IST #