Home Directory Service

Recovering Lost Files

The Home Directory Service (HDS) provides users with "snapshots," uneditable backup copies of all the files and folders in your Home Directory account, taken at a particular moment. Every two hours, HDS creates a new snapshot, and rotates an older snapshot out to make room for the new one. Some snapshots may be available for over a week, allowing to you to recover files you recently deleted.

The Snapshot System

Your Home Directory contains a folder called .snapshot, which contains your backup files. It's also "hidden" from standard directory listings (such as running the ls command on the blue.unix.virginia.edu cluster.)

Note that snapshots are not taken continuously, but on a regular schedule, so unfortunately, if you create a new file and delete it before any snapshot is taken, it is irretrievably lost.

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 which indicates how recent the snapshot is; a low number indicates a recent snapshot, and a higher number indicates an older snapshot.

The .snapshot directories are exact copies of your files and folders on the Home Directory Server. For example, if you lost a file called bar.doc inside of a file folder called foo, then you will find a backup copy of bar.doc inside of the foo directory in one of the .snapshot subdirectories.

Recovering a Snapshot

You may recover deleted files from your snapshot directory in one of two ways: either using the Home Directory Web Interface, or for more advanced users, using UNIX commands.

Using the Home Directory Web Interface

Home Directory Service users may retrieve their files from the Home Directory Account Maintenance Web page.

  1. Enter your UVa Computing ID and your blue.unix.virginia.edu 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 you want.
  7. After you have marked the files, click on the Restore these files button at the bottom of the page.
  8. If you happen to 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.

Using blue.unix.virginia.edu

Users logging in to blue.unix.virginia.edu may access their snapshots by using the snapshot UNIX command or using the snapshot directory directly.

Snapshot Recovery using the snapshot Command

Type snapshot at the UNIX prompt and follow the online instructions.

Snapshot Recovery using the .snapshot Directory

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 command to copy the files from the appropriate directory to his Home Directory.

Recovering Older Files

If you need to recover files older than your oldest snapshot file, please email your request to helpdesk@virginia.edu. The Help Desk may be able to retreive some files older than your oldest snapshot. Include the following information in your request:

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

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