Recovering Deleted Files from NFS Snapshots (Linux / Unix Systems)

Recovering Deleted Files from NFS Snapshots (Linux / Unix Systems)

Only NetApp-hosted NFS shares (such as Jubilee) support self-service snapshot recovery. Block-based storage, including OpenShift silver-iscsi PVC’s and virtual machines, does not provide this feature.

NFS shares on NetApp are automatically protected according to their assigned snapshot policy (hourly, daily, and weekly). These read-only snapshots allow users to restore deleted or overwritten files and folders directly from the NFS mount— no IT request required.

Step-by-Step Recovery for NFS Shares

1. Open a terminal on your Linux/Unix host

You must already have the NFS share mounted on Jubilee or other Netapp NFS share.

Example mount location (your path may differ):

/mnt/projects /home/research/data /nfs/share/path

2. Navigate to the hidden .snapshot directory

Each directory on an NFS share contains a special folder named .snapshot, where all snapshots are stored.

Run:

cd /path/to/your/share/.snapshot

Example:

cd /mnt/projects/.snapshot

If successful, you will see folders resembling:

daily.2024-11-28_0010 hourly.2024-11-28_1505 weekly.2024-10-12_0015

3. Browse available snapshots

List snapshot directories:

ls -lah

Snapshot naming convention:

Type

Format Example

Type

Format Example

Daily

daily.YYYY-MM-DD_0010

Hourly

hourly.YYYY-MM-DD_HHMM

Weekly

weekly.YYYY-MM-DD_0015

Choose a time closest to when the file existed.


4. Enter a snapshot to browse past content

cd hourly.2024-11-28_1505

You can now navigate as if it were a normal folder:

ls cd documents/ cd reports/

5. Recover your file by copying it back

Use cp to restore it to your live directory.

Example:

cp myfile.txt ../../myfile_restored.txt

Or whole folders:

cp -r projectA ../../projectA_restore/

Tip: Renaming helps avoid overwriting your current version.


6. Verify your recovered file

Open it normally to ensure it is the version you expected.

If not found, repeat using an earlier hourly, yesterday’s daily, or older weekly snapshot.


7. Exit snapshots when done

cd .. exit

No manual disconnect is required for NFS.