ZFS snapshot visualization in GNOME
By user13342361 on Oct 13, 2008
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)