h1. ZFS Time Slider Demo (5 Minutes)
h4. Description
Uses time-sensitive data to show off the new time-slider feature, which uses automatic ZFS snapshots to provide a "go back in time" capability.
h4. OpenSolaris Versions Supported
2008.11 and higher
h4. Points to Hit
Cool "back in time" feature is not just in proprietary operating systems. :-) For additional information:
* http://blogs.sun.com/erwann/entry/zfs_on_the_desktop_zfs
* http://blogs.sun.com/timf/en_IE/entry/zfs_automatic_snapshots_in_nv
* http://src.opensolaris.org/source/xref/jds/zfs-snapshot/README.zfs-auto-snapshot.txt
h4. Demo Prep
It is a bit tedious... but you only have to do it once. :-)
# Download and unzip this [zip file|http://wikis.sun.com/download/attachments/55118579/wisc.zip], which has the data.
# If auto snapshots are on for rpool, turn them *off*
** *pfexec zfs set com.sun:auto-snapshot=false rpool* (repeat this command for each ZFS pool that you have)
# Create a file system for the data and turn on the auto snapshots for the new file system
** *pfexec zfs create rpool/wisconsin* (or if you don't like the name "wisconsin," call it something else)
** *pfexec zfs set com.sun:auto-snapshot=true rpool/wisconsin*
# Turn off the cron job entries for everything _except_ the monthly auto snapshot. The zfssnap role is the role that runs the cron jobs. There are entries for: monthly, weekly, daily, hourly, and "frequent" (which is every 15 minutes).
** *su*
** *crontab -e zfssnap*
** Comment out (put a # in the first column) all the lines except the entry for monthly
** Save the file and exit
** *exit* (to get out of su and back to your regular userid)
# At this point, auto snapshots are *off* except for the one new file system, and the only snapshots that will be automatically taken are the monthly snapshots, which cron will run at midnight on the first day of each month. Now comes the really tedious part: Copying in the files one by one and then setting the system date/time.
** Copy from the zip file *2007-10-21.jpg* to */rpool/wisconsin*
** Set the date/time on your system to October 31, 2007 23:59:00 (*System > Administration > Time and Date*)
** After a minute elapses, the cron job for creating a monthly auto snapshot will run.
** *zfs list -t snapshot | grep wisconsin* should show an entry for:
{{rpool/wisconsin@zfs-auto-snap:monthly-2007-11-01-00:00 17K - 112K -}}
# Repeat step 5 for each file. Copy it into the directory, set the date/time to the last day of the month, 23:59:00, and then let the cron job create the monthly entry when the time rolls over to the first day of the following month. The complete list of monthly snapshots will be something like:
*zfs list -t snapshot | grep wisconsin*
{{rpool/wisconsin@zfs-auto-snap:monthly-2007-11-01-00:00 17K - 112K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2007-12-01-00:00 17K - 112K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-01-01-00:00 17K - 150K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-02-01-00:00 17K - 196K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-03-01-00:00 18K - 246K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-04-01-00:00 18K - 290K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-05-01-00:00 18K - 344K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-06-01-00:00 18K - 406K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-07-01-00:00 18K - 450K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-08-01-00:00 19K - 506K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-09-01-00:00 19K - 548K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-10-01-00:00 18K - 610K -}}
# The /rpool/wisconsin contents will be something like:
*ls -l /rpool/wisconsin*
{{-rw------- 1 auser other 55107 Oct 21 2007 2007-10-21.jpg}}
{{-rw------- 1 auser other 40292 Nov 1 2007 2007-11-21.jpg}}
{{-rw------- 1 auser other 38892 Dec 31 2007 2007-12-21.jpg}}
{{-rw------- 1 auser other 46483 Jan 1 2008 2008-01-21.jpg}}
{{-rw------- 1 auser other 50480 Feb 1 2008 2008-02-21.jpg}}
{{-rw------- 1 auser other 44035 Apr 1 2008 2008-03-21.jpg}}
{{-rw------- 1 auser other 55023 Apr 1 2008 2008-04-21.jpg}}
{{-rw------- 1 auser other 62535 May 1 2008 2008-05-21.jpg}}
{{-rw------- 1 auser other 45916 Jun 1 00:04 2008-06-21.jpg}}
{{-rw------- 1 auser other 56130 Jul 1 00:00 2008-07-21.jpg}}
{{-rw------- 1 auser other 42671 Aug 1 00:00 2008-08-21.jpg}}
{{-rw------- 1 auser other 62262 Sep 1 00:01 2008-09-21.jpg}}
# Set the system date/time to the current date/time.
# Turn on the cron job entries that were commented out earlier.
** *su*
** *crontab -e zfssnap*
** Remove the # in the first column of each line
** Save the file and exit
** *exit* (to get out of su and back to your regular userid)
# If auto snapshots were on for rpool, turn them back on
** *pfexec zfs set com.sun:auto-snapshot=true rpool* (repeat this command for each ZFS pool that you have)
h4. Gotchas
# Demo script was prepared with Solaris Nevada build 100a - but things *should* be the same once the features are integrated into OpenSolaris.
# The data are time-sensitive. So the steps shown above work fine in October 2008, but would eventually need to be adjusted going forward if you want to have 12 months worth of interesting snapshots. That's because the auto snapshot feature only keeps 12 of the monthly auto snapshots for a file system - the oldest snapshot is deleted to keep the number at 12. In other words, going forward, rename the 2007-10-21.jpg file to 2008-10-21.jpg (or go download the latest from http://www.soils.wisc.edu/asig/webcam.html), etc.
# If cron glitches and does not run the shell script that creates the monthly snapshot, you can run it manually:
** *su*
** *su - zfssnap*
** */lib/svc/method/zfs-auto-snapshot svc:/system/filesystem/zfs/auto-snapshot:monthly*
** *exit*
** *exit*
h4. Demo
* Navigate to the */rpool/wisconsin* directory in the the file explorer so that the contents are displayed:
!all.png!
* Explain that there is a university in the north-central part of the continental United States called the University of Wisconsin (at Madison, to be completely correct :-) ). They have a webcam that takes multiple pictures of the same view every day. It would be easy enough to create a cron job that would pull the photo from 2:00 PM on the 21st of every month and store it in this directory, which is what we see here.
* Delete all the files
* "Have you ever wished you did not delete a file?" :-)
* Click the *Restore* icon:
!ricon.png!
* The file display changes to show the time line:
!tline.png!
* Move the slider control one tick mark to the left (the display does not refresh until you let go of the mouse button), so that the most recent snapshot contents is displayed (which contains all the files):
!allback.png!
* Explain that all the files are available, but that's not really very impressive. After all, there are many file systems that support some type of "undo" for recovering deleted files. What's interesting about the auto snapshot feature is that _you can go back in time_. :-) Move the slider control all the way over to the entry for Dec 1, 2007:
!dec.png!
* "Back on December 1, there were only two files - the rest had not yet been created."
* Move the slider control to someplace in the middle.
* Double-click the first file to start GNOME's image viewer application:
!oct07.png!
* Click the Next button repeatedly to display the available files. Point out that there are only as many files as existed at the point in time when the snapshot was taken.
* Close the GNOME image viewer.
* Point out that you can control which file systems have auto snapshots taken: *Administration* > *Time Slider Setup* :
!tsettings.png!
h4. Demo Cleanup
None.
h4. Description
Uses time-sensitive data to show off the new time-slider feature, which uses automatic ZFS snapshots to provide a "go back in time" capability.
h4. OpenSolaris Versions Supported
2008.11 and higher
h4. Points to Hit
Cool "back in time" feature is not just in proprietary operating systems. :-) For additional information:
* http://blogs.sun.com/erwann/entry/zfs_on_the_desktop_zfs
* http://blogs.sun.com/timf/en_IE/entry/zfs_automatic_snapshots_in_nv
* http://src.opensolaris.org/source/xref/jds/zfs-snapshot/README.zfs-auto-snapshot.txt
h4. Demo Prep
It is a bit tedious... but you only have to do it once. :-)
# Download and unzip this [zip file|http://wikis.sun.com/download/attachments/55118579/wisc.zip], which has the data.
# If auto snapshots are on for rpool, turn them *off*
** *pfexec zfs set com.sun:auto-snapshot=false rpool* (repeat this command for each ZFS pool that you have)
# Create a file system for the data and turn on the auto snapshots for the new file system
** *pfexec zfs create rpool/wisconsin* (or if you don't like the name "wisconsin," call it something else)
** *pfexec zfs set com.sun:auto-snapshot=true rpool/wisconsin*
# Turn off the cron job entries for everything _except_ the monthly auto snapshot. The zfssnap role is the role that runs the cron jobs. There are entries for: monthly, weekly, daily, hourly, and "frequent" (which is every 15 minutes).
** *su*
** *crontab -e zfssnap*
** Comment out (put a # in the first column) all the lines except the entry for monthly
** Save the file and exit
** *exit* (to get out of su and back to your regular userid)
# At this point, auto snapshots are *off* except for the one new file system, and the only snapshots that will be automatically taken are the monthly snapshots, which cron will run at midnight on the first day of each month. Now comes the really tedious part: Copying in the files one by one and then setting the system date/time.
** Copy from the zip file *2007-10-21.jpg* to */rpool/wisconsin*
** Set the date/time on your system to October 31, 2007 23:59:00 (*System > Administration > Time and Date*)
** After a minute elapses, the cron job for creating a monthly auto snapshot will run.
** *zfs list -t snapshot | grep wisconsin* should show an entry for:
{{rpool/wisconsin@zfs-auto-snap:monthly-2007-11-01-00:00 17K - 112K -}}
# Repeat step 5 for each file. Copy it into the directory, set the date/time to the last day of the month, 23:59:00, and then let the cron job create the monthly entry when the time rolls over to the first day of the following month. The complete list of monthly snapshots will be something like:
*zfs list -t snapshot | grep wisconsin*
{{rpool/wisconsin@zfs-auto-snap:monthly-2007-11-01-00:00 17K - 112K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2007-12-01-00:00 17K - 112K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-01-01-00:00 17K - 150K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-02-01-00:00 17K - 196K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-03-01-00:00 18K - 246K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-04-01-00:00 18K - 290K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-05-01-00:00 18K - 344K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-06-01-00:00 18K - 406K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-07-01-00:00 18K - 450K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-08-01-00:00 19K - 506K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-09-01-00:00 19K - 548K -}}
{{rpool/wisconsin@zfs-auto-snap:monthly-2008-10-01-00:00 18K - 610K -}}
# The /rpool/wisconsin contents will be something like:
*ls -l /rpool/wisconsin*
{{-rw------- 1 auser other 55107 Oct 21 2007 2007-10-21.jpg}}
{{-rw------- 1 auser other 40292 Nov 1 2007 2007-11-21.jpg}}
{{-rw------- 1 auser other 38892 Dec 31 2007 2007-12-21.jpg}}
{{-rw------- 1 auser other 46483 Jan 1 2008 2008-01-21.jpg}}
{{-rw------- 1 auser other 50480 Feb 1 2008 2008-02-21.jpg}}
{{-rw------- 1 auser other 44035 Apr 1 2008 2008-03-21.jpg}}
{{-rw------- 1 auser other 55023 Apr 1 2008 2008-04-21.jpg}}
{{-rw------- 1 auser other 62535 May 1 2008 2008-05-21.jpg}}
{{-rw------- 1 auser other 45916 Jun 1 00:04 2008-06-21.jpg}}
{{-rw------- 1 auser other 56130 Jul 1 00:00 2008-07-21.jpg}}
{{-rw------- 1 auser other 42671 Aug 1 00:00 2008-08-21.jpg}}
{{-rw------- 1 auser other 62262 Sep 1 00:01 2008-09-21.jpg}}
# Set the system date/time to the current date/time.
# Turn on the cron job entries that were commented out earlier.
** *su*
** *crontab -e zfssnap*
** Remove the # in the first column of each line
** Save the file and exit
** *exit* (to get out of su and back to your regular userid)
# If auto snapshots were on for rpool, turn them back on
** *pfexec zfs set com.sun:auto-snapshot=true rpool* (repeat this command for each ZFS pool that you have)
h4. Gotchas
# Demo script was prepared with Solaris Nevada build 100a - but things *should* be the same once the features are integrated into OpenSolaris.
# The data are time-sensitive. So the steps shown above work fine in October 2008, but would eventually need to be adjusted going forward if you want to have 12 months worth of interesting snapshots. That's because the auto snapshot feature only keeps 12 of the monthly auto snapshots for a file system - the oldest snapshot is deleted to keep the number at 12. In other words, going forward, rename the 2007-10-21.jpg file to 2008-10-21.jpg (or go download the latest from http://www.soils.wisc.edu/asig/webcam.html), etc.
# If cron glitches and does not run the shell script that creates the monthly snapshot, you can run it manually:
** *su*
** *su - zfssnap*
** */lib/svc/method/zfs-auto-snapshot svc:/system/filesystem/zfs/auto-snapshot:monthly*
** *exit*
** *exit*
h4. Demo
* Navigate to the */rpool/wisconsin* directory in the the file explorer so that the contents are displayed:
!all.png!
* Explain that there is a university in the north-central part of the continental United States called the University of Wisconsin (at Madison, to be completely correct :-) ). They have a webcam that takes multiple pictures of the same view every day. It would be easy enough to create a cron job that would pull the photo from 2:00 PM on the 21st of every month and store it in this directory, which is what we see here.
* Delete all the files
* "Have you ever wished you did not delete a file?" :-)
* Click the *Restore* icon:
!ricon.png!
* The file display changes to show the time line:
!tline.png!
* Move the slider control one tick mark to the left (the display does not refresh until you let go of the mouse button), so that the most recent snapshot contents is displayed (which contains all the files):
!allback.png!
* Explain that all the files are available, but that's not really very impressive. After all, there are many file systems that support some type of "undo" for recovering deleted files. What's interesting about the auto snapshot feature is that _you can go back in time_. :-) Move the slider control all the way over to the entry for Dec 1, 2007:
!dec.png!
* "Back on December 1, there were only two files - the rest had not yet been created."
* Move the slider control to someplace in the middle.
* Double-click the first file to start GNOME's image viewer application:
!oct07.png!
* Click the Next button repeatedly to display the available files. Point out that there are only as many files as existed at the point in time when the snapshot was taken.
* Close the GNOME image viewer.
* Point out that you can control which file systems have auto snapshots taken: *Administration* > *Time Slider Setup* :
!tsettings.png!
h4. Demo Cleanup
None.