How to recover a lost file

All Panix accounts include storage space for home, web, and mail on RAID file servers with "snapshot" facility. This makes it possible to restore files that would otherwise be irretrievable.

The servers take "snapshots" of your files at intervals over the course of a day (slightly different intervals on different servers). We generally hold on to four "hourly" snapshots and two "nightly" ones-- more or fewer as space permits.

One note: Even with this file system, there is no guarantee that the snapshots will have exactly the file you need. If you created a file at 10am and inadvertently deleted it at 11am, it won't have been preserved. But if you created it at 10 and corrupted it a little after noon, you'll have the noon snapshot-- and you can get it yourself, right away, without having to wait for a costly restore from tape.

The snapshot directories are hidden, even from the command ls -a. To find out what snapshots are available for the data you want to retrieve, you need to know the directory that contains that data. Enter
snapshot <directoryname>
and you'll get a list of possible snapshots.
Here's what the list looks like for data in your home or web space:
1: May 24 08:00 /net/u/1/e/eg/mail/.snapshot/hourly.0
2: May 23 20:00 /net/u/1/e/eg/mail/.snapshot/hourly.1
3: May 23 16:00 /net/u/1/e/eg/mail/.snapshot/hourly.2
4: May 23 12:00 /net/u/1/e/eg/mail/.snapshot/hourly.3
5: May 23 08:00 /net/u/1/e/eg/mail/.snapshot/hourly.4
6: May 22 20:00 /net/u/1/e/eg/mail/.snapshot/hourly.5
7: May 24 00:00 /net/u/1/e/eg/mail/.snapshot/nightly.0
8: May 23 00:00 /net/u/1/e/eg/mail/.snapshot/nightly.1
Here's what it looks like for data on the mail server:
1: Feb 24 14:58 /net/mail/spool/panix/.zfs/snapshot/2011-05-23-1600.hourly
2: Feb 24 14:58 /net/mail/spool/panix/.zfs/snapshot/2011-05-23-2000.hourly
3: Feb 24 14:58 /net/mail/spool/panix/.zfs/snapshot/2011-05-24-0000.nightly
4: Feb 24 14:58 /net/mail/spool/panix/.zfs/snapshot/2011-05-24-0800.hourly

You are instructed to enter the number of the directory you want to examine, and are given instructions how to access it.

Finding the right snapshot

The first trick to recovering your file is to figure out which of the snapshots has the best version for you. The various versions rotate, so you need to figure out which one has the latest version of the file before it was removed or corrupted.

Data in your home or web space
The date to the left of the directory name in the output from snapshot command will indicate which file you need.
Data on the mail server
You need to look at the name of the snapshot, which is the date at the right side of the line,
Try man snapshot for more information.

If you are recovering mail in an active folder of the old style-- that is, in your home directory space and not available except with Unix mail clients, you want to be careful that the recovered folder doesn't overwrite data you need in the current version. Just use a different name when you copy the file. The easiest approach in recovering mail is probably to use mutt on the snapshot folder and simply save the messages you want to your current mail.

If you are familiar with the UNIX commands cp and mkdir, the instructions above should do the trick. Remember that cp -p preserves the time stamp and permissions of the original file.

Last Modified:Wednesday, 30-Jan-2013 12:14:07 EST
© Copyright 2006-2011 Public Access Networks Corporation