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).

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:
Snapshots in /net/u/.zfs/snapshot:
  1:  2018-08-29-0800.hourly
  2:  2018-08-29-0000.nightly
  3:  2018-08-28-2000.hourly
  4:  2018-08-28-1600.hourly
  5:  2018-08-28-1200.hourly
  6:  2018-08-28-0000.nightly
Snapshots in /net/snapshot/top/u:
  7:  2018-08-27-0000.nightly
  8:  2018-08-26-0000.weekly
  9:  2018-08-25-0000.nightly
 10:  2018-08-24-0000.nightly
 11:  2018-08-23-0000.nightly
 12:  2018-08-19-0000.weekly
 13:  2018-08-12-0000.weekly
 14:  2018-08-05-0000.weekly
 15:  2018-07-29-0000.weekly
 16:  2018-07-22-0000.weekly
 17:  2018-07-15-0000.weekly
 18:  2018-07-08-0000.weekly
 19:  2018-07-01-0000.weekly
 20:  2018-06-24-0000.weekly
 21:  2018-06-17-0000.weekly
 22:  2018-06-10-0000.weekly
 23:  2018-06-03-0000.weekly

Please enter the number of the directory you would like to examine,
or type a blank return to quit.
>

You are instructed to enter the number of the directory you want to examine. You will be placed in the snapshot directory you have chosen.

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. Choose a snapshot whose timestamp is previous to the file corruption or loss.

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, 29-Aug-2018 11:22:10 EDT
© Copyright 2006-2021 Public Access Networks Corporation