Snapshots: Difference between revisions

From UMIACS
Jump to navigation Jump to search
No edit summary
m (Adjusted Isilon filer example)
(48 intermediate revisions by 12 users not shown)
Line 1: Line 1:
Snapshots are a implementation of copy on write that allows for a file system to quickly take a point in time copy of the file system and provide access to the data through a .snapshot directory.
Snapshots are a implementation of [http://en.wikipedia.org/wiki/Copy-on-write copy-on-write] that allows for a file system to quickly take a point-in-time copy of the file system and provide access to the data through a .snapshot directory. Snapshots provide a fast, user-accessible way to recover data that has been accidentally deleted or corrupted within a recent time window -- rather than having to retrieve the data from comparatively slow tape backups. They also help to span the time gap between full backups.


We provide [[Snapshots]] on our [[ONStor]] filers to certain file systems.
We provide [[Snapshots]] on our ZFS, [[Snapshots:FluidFS | FluidFS]], and Isilon filers to certain file systems. If you are ever unsure if a particular volume has Snapshots enabled, please contact the [[HelpDesk | Help Desk]].


==Snapshot Policy==
==Snapshot Retention Policy==
Our core file systems in the department are on a 4 hour snapshot cycle. 


Our core file systems in the department are on a 4 hour snapshot cycle.  Snapshots are taken at,
{| class="wikitable"
 
!Snapshot Name
{| border="1"
!Retention Length
| 12am
!When is it taken?
| 4am
|-
| 8am
|'''Hourly'''
| 12pm
|24-32 hours
| 4pm
|Every day 12am, 4am, 8am, 12pm, 4pm
| 8pm
|-
|'''Daily'''
|2 days
|Every day 8pm or 12am
|-
|'''Weekly'''
|1 week
|Every Saturday 8pm or Sunday 12am
|}
|}


We retain up to 8 hourly snapshots, 2 daily snapshots and 1 weekly snapshot.
In other words, we retain up to either 6 or 8 hourly snapshots, 2 daily snapshots and 1 weekly snapshot. Hourly snapshots may be superseded by daily snapshots, and daily snapshots may be superseded by the weekly snapshot.


These are available on the following file systems,
==Snapshot Restoring==


===[[NFS]]===
If you have deleted a file by mistake and you need to get it back, you can use the snapshots directory to recopy the file.
* /nfshomes
* /fs/www
* /fs/www-users
* /fs/ftp
 
===[[CIFS]]===
* \\umiacsfs02.umiacs.umd.edu\nfshomes
* \\umaics-webftp.umiacs.umd.edu\www-umiacs
* \\umaics-webftp.umiacs.umd.edu\www-users
* \\umaics-webftp.umiacs.umd.edu\ftp-umiacs
 
==Snapshot Restoring==


If you find that you have mistakenly deleted a file and it was created/written to before the last snapshot[1].  You can restore the file by going to the directory where the file was and changing into the .snapshot directory and then using a normal copy operation to copy it back to the directory where you would like it.  Please note that the .snapshot directory is hidden and may not appear when you do a directory listing.
This directory can typically be found in your home directory. It generally will not be visible, even when viewing hidden directories.


''[1] - If a file was created or modified after the last snapshot then you can potentially lose up to 4 hours of work in a worse case scenerio.  Please make sure you save your work throughout the day.''
'''It will be either''':


Example:
* .snapshots for the [[Snapshots:FluidFS | FluidFS]] filer
* .zfs/snapshot for the ZFS filer
* .snapshot for the Isilon filer


Changing to my quotes directory.
The inside of one of these will look something like this on a FluidFS filesystem:
<pre>
[derek@novelty quotes]$ pwd
/nfshomes/derek/work/quotes
</pre>
I see that i have a quote called  '''redhat_sole_source_2007.doc'''.
<pre>
[derek@novelty quotes]$ ls
dlt_pdf_quote2007.pdf  Quote_300086759.html        redhat_solesource.pdf
dlt_pdf_quote.pdf      Quote_353511914.html        soleSource2007.pdf
dlt_quote.pdf          Quote_367512608.html        soleSource.pdf
dy1014.xls            Quote_367884529.html        UMD_008.xls
Quote_250530976.html  redhat_sole_source_2007.doc
</pre>
<pre>
[derek@novelty quotes]$ ls -la redhat_sole_source_2007.doc
-rw-r--r-- 1 derek derek 39936 Jan 23  2007 redhat_sole_source_2007.doc
</pre>
I will remove it from the current file system.
<pre>
[derek@novelty quotes]$ rm redhat_sole_source_2007.doc
</pre>
As you can see it no longer is there.
<pre>
[derek@novelty quotes]$ ls
dlt_pdf_quote2007.pdf  Quote_250530976.html  Quote_367884529.html  UMD_008.xls
dlt_pdf_quote.pdf      Quote_300086759.html  redhat_solesource.pdf
dlt_quote.pdf          Quote_353511914.html  soleSource2007.pdf
dy1014.xls            Quote_367512608.html  soleSource.pdf
</pre>
I am going to go into the last hourly snapshot '''hourly.0'''
<pre>
[derek@novelty quotes]$ cd .snapshot/hourly.0
</pre>
As you can see the quote is still here.
<pre>
[derek@novelty hourly.0]$ ls
dlt_pdf_quote2007.pdf  Quote_300086759.html        redhat_solesource.pdf
dlt_pdf_quote.pdf      Quote_353511914.html        soleSource2007.pdf
dlt_quote.pdf          Quote_367512608.html        soleSource.pdf
dy1014.xls            Quote_367884529.html        UMD_008.xls
Quote_250530976.html  redhat_sole_source_2007.doc
</pre>
I copy it back to the original directory.
<pre>
<pre>
[derek@novelty hourly.0]$ cp redhat_sole_source_2007.doc /nfshomes/derek/work/quotes/
sattwood@zaphod:~$ pwd
/nfshomes/sattwood
sattwood@zaphod:~$ cd .snapshots
sattwood@zaphod:~/.snapshots$ ls
daily_2018_06_14__20_00  hourly_2018_06_14__12_00  hourly_2018_06_15__04_00  weekly_2018_06_09__20_00
daily_2018_06_15__20_00  hourly_2018_06_14__16_00  hourly_2018_06_15__08_00 
hourly_2018_06_14__08_00  hourly_2018_06_14__00_00  hourly_2018_06_15__12_00 
</pre>
</pre>
Change back to the original directory.
Or this, on a ZFS filesystem:
<pre>
<pre>
[derek@novelty hourly.0]$ cd /nfshomes/derek/work/quotes/
sattwood@swirl:~$ pwd
/nmhomes/sattwood
sattwood@swirl:~$ cd .zfs/snapshot
sattwood@swirl:~/.zfs/snapshot$ ls
zfs-auto-snap_daily-2018-06-13-01h00  zfs-auto-snap_hourly-2018-05-28-00h00
zfs-auto-snap_daily-2018-06-14-01h00  zfs-auto-snap_hourly-2018-05-29-00h00
zfs-auto-snap_daily-2018-06-15-01h00  zfs-auto-snap_hourly-2018-06-03-16h00
zfs-auto-snap_hourly-2018-05-24-00h00  zfs-auto-snap_hourly-2018-06-10-08h00
zfs-auto-snap_hourly-2018-05-25-00h00  zfs-auto-snap_hourly-2018-06-15-12h00
zfs-auto-snap_hourly-2018-05-26-00h00  zfs-auto-snap_weekly-2018-06-09-03h00
</pre>
</pre>
And it is back.
Or this, on an Isilon filesystem:
<pre>
<pre>
[derek@novelty quotes]$ ls
sattwood@coffee:~$ pwd
dlt_pdf_quote2007.pdf  Quote_300086759.html        redhat_solesource.pdf
/nfshomes/sattwood
dlt_pdf_quote.pdf      Quote_353511914.html        soleSource2007.pdf
sattwood@coffee:~$ cd .snapshot
dlt_quote.pdf          Quote_367512608.html        soleSource.pdf
sattwood@coffee:~/.snapshot$ ls
dy1014.xls            Quote_367884529.html        UMD_008.xls
nfshomes_2018-06-14_00:00  nfshomes_2018-06-15_04:00
Quote_250530976.html  redhat_sole_source_2007.doc
nfshomes_2018-06-14_16:00  nfshomes_2018-06-15_08:00
nfshomes_2018-06-14_20:00  nfshomes_2018-06-15_12:00
nfshomes_2018-06-15_00:00  Weekly_nfshomes_2018-06-10_00:00
</pre>
</pre>
For an example of file restoration, please see [[Snapshots:Example | this page]].




[[Category:Snapshots]]
__NOTOC__
__NOTOC__

Revision as of 18:52, 25 November 2020

Snapshots are a implementation of copy-on-write that allows for a file system to quickly take a point-in-time copy of the file system and provide access to the data through a .snapshot directory. Snapshots provide a fast, user-accessible way to recover data that has been accidentally deleted or corrupted within a recent time window -- rather than having to retrieve the data from comparatively slow tape backups. They also help to span the time gap between full backups.

We provide Snapshots on our ZFS, FluidFS, and Isilon filers to certain file systems. If you are ever unsure if a particular volume has Snapshots enabled, please contact the Help Desk.

Snapshot Retention Policy

Our core file systems in the department are on a 4 hour snapshot cycle.

Snapshot Name Retention Length When is it taken?
Hourly 24-32 hours Every day 12am, 4am, 8am, 12pm, 4pm
Daily 2 days Every day 8pm or 12am
Weekly 1 week Every Saturday 8pm or Sunday 12am

In other words, we retain up to either 6 or 8 hourly snapshots, 2 daily snapshots and 1 weekly snapshot. Hourly snapshots may be superseded by daily snapshots, and daily snapshots may be superseded by the weekly snapshot.

Snapshot Restoring

If you have deleted a file by mistake and you need to get it back, you can use the snapshots directory to recopy the file.

This directory can typically be found in your home directory. It generally will not be visible, even when viewing hidden directories.

It will be either:

  • .snapshots for the FluidFS filer
  • .zfs/snapshot for the ZFS filer
  • .snapshot for the Isilon filer

The inside of one of these will look something like this on a FluidFS filesystem:

sattwood@zaphod:~$ pwd
/nfshomes/sattwood
sattwood@zaphod:~$ cd .snapshots
sattwood@zaphod:~/.snapshots$ ls
daily_2018_06_14__20_00   hourly_2018_06_14__12_00  hourly_2018_06_15__04_00  weekly_2018_06_09__20_00
daily_2018_06_15__20_00   hourly_2018_06_14__16_00  hourly_2018_06_15__08_00  
hourly_2018_06_14__08_00  hourly_2018_06_14__00_00  hourly_2018_06_15__12_00  

Or this, on a ZFS filesystem:

sattwood@swirl:~$ pwd
/nmhomes/sattwood
sattwood@swirl:~$ cd .zfs/snapshot
sattwood@swirl:~/.zfs/snapshot$ ls
zfs-auto-snap_daily-2018-06-13-01h00   zfs-auto-snap_hourly-2018-05-28-00h00
zfs-auto-snap_daily-2018-06-14-01h00   zfs-auto-snap_hourly-2018-05-29-00h00
zfs-auto-snap_daily-2018-06-15-01h00   zfs-auto-snap_hourly-2018-06-03-16h00
zfs-auto-snap_hourly-2018-05-24-00h00  zfs-auto-snap_hourly-2018-06-10-08h00
zfs-auto-snap_hourly-2018-05-25-00h00  zfs-auto-snap_hourly-2018-06-15-12h00
zfs-auto-snap_hourly-2018-05-26-00h00  zfs-auto-snap_weekly-2018-06-09-03h00

Or this, on an Isilon filesystem:

sattwood@coffee:~$ pwd
/nfshomes/sattwood
sattwood@coffee:~$ cd .snapshot
sattwood@coffee:~/.snapshot$ ls
nfshomes_2018-06-14_00:00  nfshomes_2018-06-15_04:00
nfshomes_2018-06-14_16:00  nfshomes_2018-06-15_08:00
nfshomes_2018-06-14_20:00  nfshomes_2018-06-15_12:00
nfshomes_2018-06-15_00:00  Weekly_nfshomes_2018-06-10_00:00

For an example of file restoration, please see this page.