Retrieving Deleted Files
Retrieving Deleted Files
These directions
will help you retrieve your files if you are using either the Unix cluster blue.unix.virginia.edu
or the Home Directory Service. Users of other Unix systems or blue.unix
users that have purchased disk wedges from ITC need to ask ITC to restore
files from backup tapes.
Table of Contents
Introduction
The Home Directory
Service offers "snapshots," a very useful feature for file backup and retrieval.
A snapshot
is an uneditable copy of all the files and directories in the NetApp taken at
a particular moment. This term is analogous to taking a photograph, which is
a copy of a set of images at a particular time. Every two hours, the NetApp
creates a new snapshot for users. The NetApp then rotates the older snapshots
around. They remain for about a week before getting deleted.
The "Snapshot" Directories
Each directory in
the NetApp filesystem contains a directory called .snapshot, which
usually does not appear in directory listings on blue.unix.virginia.edu.
(The .snapshot directory is only visible at the mount point
of the NetApp filesystem.) You must locate the .snapshot directory
on the system to use it.
Beneath the .snapshot
directory are some more directories, each of which corresponds to a snapshot.
The hourly snapshots are named hourly.N; nightly snapshots
are in nightly.N. N is a number where the lower
numbers are the more recent snapshots. Note that snapshots are not taken continuously,
but on a regular schedule. If you create a new file and delete it before any
snapshot is taken, it is irretrievably lost.
The .snapshot
directories are exact copies of the directories on the Home Directory Server.
If you lost a file called bar inside of a directory called foo,
then you will find a copy of bar inside of the foo directory
in one of the .snapshot directories.
Retrieving Files with the
"Snapshot" Command
In many cases, you
will be able to restore your own files using ITC's Unix Menu System (Umenu).
This system is on blue.unix.virginia.edu. From the main menu, select:
Cluster Commands
Then select:
Snapshot
and follow the
on-line instructions.
Or, you may type
the command:
snapshot
at the Unix prompt
on blue.
Retrieving Files without
the "Snapshot" Command
Home Directory
Service web page
Home Directory
Service users may retrieve their files from the
Home Directory Account Maintenance web page.
- Enter your
UVa Computing ID and your Home Directory Service password. Click on the "Connect"
button.
- Click on the
"Restore your files" link from the Configuration Options Menu.
- You will then
see a listing of your subdirectories in your home directory. If the file you
want to restore is in not in the current directory, then click on the links
with the directory names to go into the appropriate directory.
- Then, click
on the "Restore files from this directory" link.
- After you have
clicked on the "snapshot" link, then you will see a page with a listing of
dates on which the snapshots were taken. Click on the date nearest to and
before the time that you deleted your file.
- You will then
see a page listing all the files in that directory at the time the system
took the snapshot. Each file will have a checkbox beside it. Click on the
checkboxes to mark the files.
- After you have
marked the files that you want, click on the "Restore these files" button
at the bottom of the page.
- If you already
have a file with the same name in your directory, you will see a screen full
of options on how to handle this situation. Otherwise, you will see a confirmation
message that the system has restored the files to their old locations.
Accessing
the .snapshot Directory Directly on Blue
Blue.unix
users may also retrieve their files by directly accessing the invisible .snapshot
directory inside of their home directories. This feature is useful for systems
that use the Home Directory Service, but do not have the "snapshot" command
available. For example, if user "mst3k" were searching for a deleted directory
called "foo," then inside of his home directory he could type at the Unix command
prompt:
ls -lt .snapshot/*/foo
to search through
the snapshots for a directory called "foo." The output would resemble:
-rw-r--r-- 1 mst3k other 5347 Aug 12 11:32 .snapshot/hourly.0/foo
-rw-r--r-- 1 mst3k other 5347 Aug 12 11:32 .snapshot/hourly.1/foo
-rw-r--r-- 1 mst3k other 5213 Aug 12 10:01 .snapshot/hourly.2/foo
-rw-r--r-- 1 mst3k other 5213 Aug 12 10:01 .snapshot/nightly.1/foo
-rw-r--r-- 1 mst3k other 4774 Aug 11 13:07 .snapshot/nightly.0/foo
He could then use
the Unix cp to copy the files from the appropriate directory to his home
directory.
Getting Files Restored
from Tape
Send email to:
unix-consult@virginia.edu
Please specify
as much of the following information as you can. A reasonable guess is better
than nothing:
- Complete pathname
of the file. Include the directory if the file was not in the top directory
of your account.
- Name of the
machine where the file is missing. Your account may be shared on a group of
machines (such as the Unix lab), so just name one of them.
- Modification
date and time of the file you want restored. Backup tapes written before this
time will either not have the file or have an earlier version of it.
- Date and time
when the file was lost. Backup tapes written after this time will not have
the file.
Send questions
or comments to consult@virginia.edu
Home Directory
Service home page