Getting deleted files back

I accidentally deleted or corrupted files that I need. How do I get them back?

Most home directory, shared, public, and website spaces use snapshots. Thus, older versions of deleted or changed files are kept on disk for between two and four weeks and you can get them back without having to email MSI staff. Read further for the steps on restoring a file or directory that was recently deleted.

Note: There is no snapshot for scratch space. If the files were in scratch space, it is not possible to restore them.

For home directory, shared, public, and /website spaces, cd to the home directory, shared, public or website space, and then:

cd .snapshot

Note: You will not see the snapshot directory if you type ls.

Once you are in the snapshot directory, you will see the available snapshot subdirectories dated with when the copy was made. You can choose to copy the desired version of your file. You can copy it back to your home directory, website space, shared or public space using cp command and then continue to use it as normal.

  • Panasas file system (e.g. /panfs/jay/groups/...) has daily (keep two) and weekly (keep three) snapshots. This means there are two snapshots taken within the last 48 hours, plus three additional snapshots within the last 21 days.

  • VAST file system (e.g. /projects/standard/...) has six nightly and four weekly snapshots. This means there are seven snapshots within the last seven days plus four additional snapshots within the last month.

If you cannot find the desired files in the on-disk snapshots, you can email [email protected] with the full path to the files and any details about the content of the file. See the Policies page for data protection and retention policies.

Steps to restore a file or directory from snapshot

  1. Navigate to the parent directory where the file was deleted, and change directory into '.snapshot'
    1. cd .snapshot
  2. List out the available snapshots and take note of the most recent date that is listed
    1. ls -ltr
  3. Change directories into the most recent snapshot and check whether your file/directory is present.
    1. If the file/directory is not present, check the other snapshots for copies
  4. If the file you want to restore is present, use the copy command 'cp' to copy the file back to the parent directory
    1. cp -a FILE_NAME ../..
    2. Replace FILE_NAME with the file or directory that you are restoring.
  5. After the copy is complete, change directories back to the parent directory
    1. cd ../..

 

 

Discover Advanced Computing and Data Solutions at MSI

Our Services