© 2008 by the Rector and Visitors of the University of Virginia.

The information contained on the University of Virginia’s Department of Information Technology and Communication (ITC) website is provided as a public service with the understanding that ITC makes no representations or warranties, either expressed or implied, concerning the accuracy, completeness, reliability or suitability of the information, including warrantees of title, non-infringement of copyright or patent rights of others. These pages are expected to represent the University of Virginia community and the State of Virginia in a professional manner in accordance with the University of Virginia’s Computing Policies.

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.

  1. Enter your UVa Computing ID and your Home Directory Service password. Click on the "Connect" button.
  2. Click on the "Restore your files" link from the Configuration Options Menu.
  3. 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.
  4. Then, click on the "Restore files from this directory" link.
  5. 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.
  6. 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.
  7. After you have marked the files that you want, click on the "Restore these files" button at the bottom of the page.
  8. 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:


Send questions or comments to consult@virginia.edu

Home Directory ServiceHome Directory Service home page