Can I recover a deleted file?

Yes, sometimes. The NSC Centre Storage system uses "snapshots" (a read-only point-in-time view of the file system that can be used to restore files from).

Snapshots are taken at certain intervals (several times per day). All snapshots are kept for the last 24 hours, and one snapshot per day are kept for a week.

Note: the SMHI storage system Accumulus (mounted under /nobackup) does not use snapshots, so restoring files deleted from /nobackup is not possible.

Snapshots are available on /home and /proj.

To recover deleted files from a snapshot (or check the contents of a file as is was at an earlier time), go to /proj/.snapshots or /home/.snapshots. There you will find one directory per available snapshot. Then change into the snapshot directory (e.g cd 2018-06-26T1100+0200), and you will see the files as they were at the time the snapshot was taken. To "undelete" a file, simply copy it to a location outside the .snapshots directory tree.

Files created and deleted in the time between when two snapshots were taken cannot be restored.

Files that were deleted too long ago (before the currently oldest snapshot was taken) cannot be restored from snapshots.

Example - restoring a file from a snapshot:

Oops, I have accidentally deleted a file:

[kronberg@tetralith1 ~]$ ls -al /proj/nsc/users/kronberg/ior.*
ls: cannot access /proj/nsc/users/kronberg/ior.*: No such file or directory

List the available snapshots:

[kronberg@tetralith1 ~]$ ls -lrt /proj/.snapshots/
total 0
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-27T0800+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-27T0001+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-26T1701+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-26T1601+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-26T1501+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-26T1401+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-26T1301+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-26T1201+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-26T1100+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-26T1000+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-26T0901+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-26T0801+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-26T0000+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-25T0001+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-24T0001+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-23T0000+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-22T0000+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-21T0001+0200
drwxr-xr-x 241 root root 4096 Jun 15 14:41 2018-06-20T1000+0200

Check in which snapshots my missing file is present:

[kronberg@tetralith1 ~]$ ls -al /proj/.snapshots/*/nsc/users/kronberg/ior.*
-rw-r--r-- 1 kronberg pg_nsc 1099511627776 Oct 17 16:38 /proj/.snapshots/2018-06-26T0901+0200/nsc/users/kronberg/ior.testfile.tetralith

Restore the file by copying a version (in this case, the latest one) of it:

[kronberg@tetralith1 ~]$ cp /proj/.snapshots/2018-06-26T0901+0200/nsc/users/kronberg/ior.testfile.tetralith /proj/nsc/users/kronberg/
[kronberg@tetralith1 ~]$ ls -al /proj/nsc/users/kronberg/ior.*
-rw-r--r-- 1 kronberg pg_nsc 1099511627776 Oct 27 12:12 /proj/nsc/users/kronberg/ior.testfile.tetralith
[kronberg@tetralith1 ~]$ 

Tape backups

For disaster recovery purposes, we make tape backups of the /home and /software directories at least weekly.

If you want us to try to recover a file from your home directory that's not available in any snapshot from tape backups, please contact NSC Support and provide as much information as possible (e.g directory, file name(s), when the file(s) were on disk).


User Area

User support

Guides, documentation and FAQ.

Getting access

Applying for projects and login accounts.

System status

Everything OK!

No reported problems

Self-service

SUPR
NSC Express