ZFS snapshot visualization in GNOME


Time slider is one of the new feature that will be available in OpenSolaris 2008.11.

Time slider provides an automatic way to backup your data on the same disc using one of Sun's ZFS filesystem unique features, snapshots.
With time slider you can browse and recover files from snapshot backups using the GNOME file manager.

If you prefer to watch a video rather than read the rest of this post, I've also made a  3 min screencast about time slider.

This feature is made on 3 separate components :
  • The ZFS automatic Snapshots SMF services developed by Tim Foster :
    These services are used by time slider to schedule recurring snapshots on ZFS filesystems.
  • The Time slider SMF service and UI developed by Niall Power :
    This service determine when and which zfs filesystem to snapshot based on a set schedule (by default : at every boot, then every 15 minutes, then every hour, then every day, etc.)
    This service also monitor the snapshotted filesystems and avoid filling them up by removing the oldest snapshots based on a user predefined percentage of filesystem to be used.
  • And finally the nautilus ZFS snapshot visualization integration I developed. This part, explained below, allow the user to browse and restore files graphically using the GNOME file manager.

A big thanks to :

  • Tim for his help on top his "real" work :)
  • Usability wise to Calum Benson for his ideas and Jaime Guerrero for the slider, icons and name.

How to enable it ?

Time slider is disabled by default on OpenSolaris. You can enable it via System -> Administration -> time slider setup.


How to Browse my snapshots ?

To browse your on-disk backups open any folder with the file manager and see if the restore icon is enabled (icon highlighted in the image below).
 If it is enabled this means that backups of this directory are available.



Once pressed an additional navigation bar appears. It gives you information about :

  • the timeline your can explore.
  • your current location in the backup timeline (the image below shows that you are still browsing your current directory)
  • the number of snapshot backups available for this directory and the space used by the overall zfs snapshots.


You can then drag the slider into the past to retrieve previous versions of your documents and folders. You can open all your files in read only mode.
Note that from build 101 onward if you browse in list view mode (as oppose to icon view) a "restore information" column automatically appears.
This column gives you contextual information about either :

  • the number of different version available for each file, if you browse in the current/latest version of a directory.
  • the difference (if any exist) between the snapshotted file and the latest version of the file.


How do I restore files from backups ?

You can restore previous versions of files and directories by either :

  • simply drag and dropping them into another file manager window.
  • by right clicking on the mouse and selecting "restore to Desktop".
  • copy and pasting the selection to present time.


Note : You can disable the zfs snapshot timeline visualization in nautilus via the global preferences dialog (menu edit->preferences). Once in the dialog select the "Preview" tab and in the folder section uncheck "Visualize ZFS snapshots timeline".

Where is the source ?

The zfs automatic snapshots hg repository can be found here. Its spec-file can be found here.
The time slider repository can be found here. Its spec-file there.
The nautilus visualization patch for nautilus can be found here.

If you want to create either the packages or simply build the code use the JDS common build environment.

What's next ?

The next possible steps among others for this project are :

  • UI enhancements :
    - a restore tab plugin for the file properties dialog.
    - clutter based slider widget to provide more information about about the snapshots available.
    - graphical mean to modify time slider's schedule.
  • new features :
    - removable media based off disk backups
    - network based backups

If you want to get involved you can grab the code and play with it. If you want to contribute let me know :)


Update (Fri Nov 14) :
 - changed screenshots to integrate the new time slider icon in nautilus (see comments)
 - added info about the disable option in nautilus (see email thread for details)

Comments:

WOW!! Very cool!!

I must try this now!

Thank you for sharing the code!

Posted by Iban on October 13, 2008 at 04:49 PM CEST #

Very nice!
2008.11 is looking like it will be a fantastic release.

great work!

Posted by Ché Kristo on October 13, 2008 at 05:31 PM CEST #

Hey Erwann, any chance we can get a better icon for the toolbar icon? I don't think the spanner/life ring really works. Perhaps something like a clock is better, to give the idea that you're going back in time?

Posted by Glynn Foster on October 13, 2008 at 07:37 PM CEST #

I concur with Glynn :)

Isn't that icon for Gnome Help?

Posted by Che Kristo on October 14, 2008 at 07:11 AM CEST #

Brilliant !!! A ZFS based "Time Machine-esque" function on Solaris.

I concur with Glynn, the gnome help icon isn't a good choice.

Posted by lildude on October 14, 2008 at 08:04 AM CEST #

I'll see if I can get a more appropriate icon redesigned :)

Posted by Erwann on October 14, 2008 at 08:07 AM CEST #

very nice, hopefully usable in linux aswell in the future (btrfs or even zfs? ;))

as for the icon, what about something like an archeological excavation, maybe some bones in the sand or so. "bringing old stuff back to the light of today". just an idea ;)

Posted by baze on October 14, 2008 at 10:18 AM CEST #

I-N-C-R-E-D-I-B-L-E!

One feature request though:

Possibility to edit files in a snapshot. Then the edited version could be saved in a new snapshot.

E.g.: You take a picture, save it to a folder. Then convert it to B/W in Gimp, save again. Oh no, I need that picture in color, too. Browse to the first snapshot, open in Gimp, save. Now you have 3 snapshots. All this just to avoid the Copy-n-Paste, copying, ... it could be done automatically.

Posted by Anton on October 14, 2008 at 10:24 AM CEST #

Congrats! It looks just amazing.

It'd great if we got a python-zfs module though. I do know it wasn't your call, but using popen4 all along the code is kind of clumsy.

Anyway, it's a huge step forward for the OpenSolaris desktop. Congratulations!!

..hope you're doing fine dude! :-)
Cheers!

Posted by Alvaro Lopez Ortega on October 14, 2008 at 11:05 AM CEST #

I made a quick mockup of the bar, a bit more similar to the one Nautilus shows now for special folders like Trash:

http://img231.imageshack.us/img231/1114/pantallazo1az6.png

Posted by David Prieto on October 14, 2008 at 11:16 AM CEST #

Hi David,

It was the original idea but because nautilus refreshes directory "view" each time you change
directory you'll have to recreate the slider bar each time your changing directory. As that happens every
time the slider is moved the user experience wasn't great. On top of that having the slider bar as a
navigation bar gives you more screen real estate hence you can display more information.

Erwann

Posted by Erwann on October 14, 2008 at 11:40 AM CEST #

Hi Erwann,

Thanks for the reply. The screenshots really looks enormously exciting anyway. Hope to see this in Ubuntu 9.04 :-)

Posted by David Prieto on October 14, 2008 at 11:55 AM CEST #

This is starting to look pretty nice. Minor comments:

(0) I know everyone else has said it, but if you can't fix anything else, please change that icon :)

(1) Can you clean up the URI shown in the time slider bar? "/export/home/erwannc/Desktop/time slider demo" would look a lot nicer than "file://export/home/erwannc/Desktop/time%20slider%demo" :)

(2) The menu item name should probably just be "Time Slider", without the "Setup" part. Everything on the prefs/admin menus is about "setup", so it's redundant to say so (and it's a word we try to avoid using in GNOME apps anyway).

Posted by Calum Benson on October 14, 2008 at 12:12 PM CEST #

Oh, also there's a typo in the slider bar: "currently using in <size>" should be "currently using <size>", or just "current size: <size>".

And the unit for kilobytes should be "KB", not "K". (Actually, I thought it should be "kB", but nautilus itself seems to use "KB".)

Posted by Calum Benson on October 14, 2008 at 12:16 PM CEST #

By the way, I came up with another possibility: replacing the path bar, just as the search button does. It would save some space and show a slightly cleaner interface:

http://img134.imageshack.us/img134/3203/pantallazogi4.png

The remaining data could be shown on a tooltip when hovering the cursor over the throbber:

http://img143.imageshack.us/img143/2883/pantallazo2zo3.png

Just throwing some ideas, I hope you find them useful.

Posted by David Prieto on October 14, 2008 at 12:34 PM CEST #

As for the icons, there are several that would look good. Two possibilities would be document-open-recent, or time-admin.

http://img75.imageshack.us/img75/9291/sinnombreql2.png

Posted by David Prieto on October 14, 2008 at 12:47 PM CEST #

I suspect it may not be possible to replace existing toolbars using a nautilus plugin....?

Posted by Calum Benson on October 14, 2008 at 12:48 PM CEST #

I honestly have no idea whether it can be done, sorry. I just thought it would be neat, if possible.

Posted by David Prieto on October 14, 2008 at 01:11 PM CEST #

I like David's cleanup of the slider bar removing the text on top, fwiw, though I think I would keep the ticks, but move some of the other information to a popup. Not sure if Calum or Erwann agrees though :)

Posted by Glynn Foster on October 14, 2008 at 02:38 PM CEST #

Yeah, I definitely agree with keeping the ticks.

Posted by David Prieto on October 14, 2008 at 02:51 PM CEST #

Looks awesome! Can't wait to try this out in 2008.11.

Oh, and I agree with the others about the choice of icon.

Posted by Haik on October 15, 2008 at 03:41 PM CEST #

Very neat... now get a nice blue police box for an icon :-)

Posted by barts on October 15, 2008 at 10:26 PM CEST #

Pretty amazing add-on! Makes OpenSolaris even more compelling!
I assume this is all CDDL?

Posted by Brent Jones on October 16, 2008 at 01:21 AM CEST #

Hey Erwann,

this is brilliant stuff.
I want to do the same for KDE, so that my work can go into KDE, where it will be used in belenix.

Unfortunately, I cant seem to find the sources.. :(

The spec file ( http://src.opensolaris.org/source/xref/jds/spec-files-other/trunk/core/SUNWgnome-time-slider.spec) refers to a tarball..

I would actually like to see the contents of the "nautilus-zfs.h" and "nautilus-zfs.c" files

While I have located the diff/patch.. ( http://src.opensolaris.org/source/xref/jds/spec-files/branches/gnome-2-24/patches/nautilus-13-zfs-snapshot.diff) I need to see those source files

Posted by Manish Chakravarty on October 16, 2008 at 01:43 AM CEST #

Thanks... finally we've get a body for the superb zfs engine.

Good tools give to the users a good feeling about a product. You've got a very powerful engine, but now it can even more shines.

I'm now asking a good tool to manage zfs backups politics. Like giving the user or admin the ability to say how things as to be backed up. Such tool will help setting up politics like:
- keep X backup, whith backup happening each week or month..
- exponential expiry ( http://backuppc.sourceforge.net/faq/BackupPC.html#backup_basics )
we all know that such things can be easily writable with a script. But it takes time to do a good one and to test it. And not every since admins have that much time to write it, and I didn't see good script on the net. So..... Don't wait a write a nice CLI to start and later write the GUI around it. We are all waiting for this !!!!

Posted by cEd on October 16, 2008 at 02:54 AM CEST #

If I have, say a 3D visualisation widget, ala coverflow, would it be possible to use the code to embed it in nautilus and make the widget interact with the chosen file ?

(I'm talking about this https://edge.launchpad.net/gloobus and we're discussing it here:http://ubuntuforums.org/showthread.php?t=828774&page=21 )

Posted by PierreS on October 16, 2008 at 03:31 AM CEST #

cEd that happens already (exponential expiry, and a way for users to configure those schedules), but there's no GUI to configure the options. It's been in the core zfs-auto-snapshot code that time-slider uses for quite a long time :-)

More at
http://src.opensolaris.org/source/xref/jds/zfs-snapshot/README.zfs-auto-snapshot.txt

Posted by Tim Foster on October 16, 2008 at 02:39 PM CEST #

That's amazing.
I really I'd like to use this in my desktop.

Posted by Silveira Neto on October 16, 2008 at 05:53 PM CEST #

Long live Solaris. With these kind of features, surely it is going to win hearts of developers and common users. Superb work.

Posted by Ashish Nabira on October 17, 2008 at 02:31 AM CEST #

Is there any reason to use libzfs functions in the Nautilus patch?
This way, the new functionality can be used neither via NFS, even
though .zfs/snapshots is available there as well, nor on non-Solaris
operating systems.

Posted by Rainer Orth on October 17, 2008 at 09:12 AM CEST #

Hi Calum,

Bug reports are welcome :) here :
http://defect.opensolaris.org

Posted by Erwann on October 19, 2008 at 07:49 AM CEST #

Hi Manish,

The source for nautilus-zfs.[hc] is in the patch you mention at
line 602 and 1176.

HTH

Posted by Erwann on October 19, 2008 at 07:53 AM CEST #

Hi Rainer,

Good point, I thought about it but didn't figure out a comprehensive
solution.

libzfs is needed for example to retrieve the creation time of the
snapshot as oppose to the creation time of the directory when the
snapshot was taken. For the initial release, I didn't when to start
relying on additional information outside what zfs provide. To make
it work over NFS, etc we'll need to keep somewhere else (maybe
the snapshot name) the snapshot creation time. For this we have
to assume that every snapshot will hold that additional information
otherwise the snapshot timeline wouldn't be accurate.

Posted by Erwann on October 19, 2008 at 08:01 AM CEST #

Post a Comment:
Comments are closed for this entry.
About

user13342361

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today