I want to view snapshots for my Amazon FSx for NetApp ONTAP file system.
Resolution
There are two ways to view FSx for ONTAP snapshots:
- View snapshots from the client machine where you mounted the file system.
- View snapshots after you connect to the FSx for ONTAP file system through SSH.
View the snapshots from the client machine where you mounted the file system
1. By default, snapshots are stored in the .snapshot directory at the volume root. Navigate to the directory where you mounted the file system, as shown in the following example:
$ ls -la /fsxfilesystem
total 12
drwxr-xr-x 4 root root 4096 Mar 8 07:21 .
dr-xr-xr-x 22 root root 309 Aug 12 08:10 ..
drwxrwxrwx 13 root root 4096 Aug 12 08:05 .snapshot
drwxr-xr-x 2 root root 4096 Mar 9 05:44 fsxvol
2. To view the snapshots in the .snapshot directory, run the ls -la /fsxfilesystem/.snapshot command:
$ ls -la /fsxfilesystem/.snapshot
total 52
drwxrwxrwx 13 root root 4096 Aug 12 08:05 .
drwxr-xr-x 4 root root 4096 Mar 8 07:21 ..
drwxr-xr-x 4 root root 4096 Mar 8 07:21 backup-040db63a5fcf46442
drwxr-xr-x 4 root root 4096 Mar 8 07:21 daily.2023-08-11_0010
drwxr-xr-x 4 root root 4096 Mar 8 07:21 daily.2023-08-12_0010
drwxr-xr-x 4 root root 4096 Mar 8 07:21 hourly.2023-08-12_0305
drwxr-xr-x 4 root root 4096 Mar 8 07:21 hourly.2023-08-12_0405
drwxr-xr-x 4 root root 4096 Mar 8 07:21 hourly.2023-08-12_0505
drwxr-xr-x 4 root root 4096 Mar 8 07:21 hourly.2023-08-12_0605
drwxr-xr-x 4 root root 4096 Mar 8 07:21 hourly.2023-08-12_0705
drwxr-xr-x 4 root root 4096 Mar 8 07:21 hourly.2023-08-12_0805
drwxr-xr-x 4 root root 4096 Mar 8 07:21 weekly.2023-07-30_0015
drwxr-xr-x 4 root root 4096 Mar 8 07:21 weekly.2023-08-06_0015
NFSv4 mounted file systems
If you can't view the .snapshot directory in the ls -la /fsxfilesystem command output, then your file system might be mounted with Network File System (NFS) v4.
If your file system is mounted with NFSv4, then you don't see the .snapshot directory, as shown in the following example:
$ ls -la /fsxfilesystem
total 8
drwxr-xr-x 4 root root 4096 Mar 8 07:21 .
dr-xr-xr-x 22 root root 309 Aug 12 08:10 ..
drwxr-xr-x 2 root root 4096 Mar 9 05:44 fsxvol
List the snapshots using the ls -la /fsxfilesystem/.snapshot command:
$ ls -la /fsxfilesystem/.snapshot
total 52
drwxrwxrwx 13 root root 4096 Aug 12 08:05 .
drwxr-xr-x 4 root root 4096 Mar 8 07:21 ..
drwxr-xr-x 4 root root 4096 Mar 8 07:21 backup-040db63a5fcf46442
drwxr-xr-x 4 root root 4096 Mar 8 07:21 daily.2023-08-11_0010
drwxr-xr-x 4 root root 4096 Mar 8 07:21 daily.2023-08-12_0010
drwxr-xr-x 4 root root 4096 Mar 8 07:21 hourly.2023-08-12_0305
drwxr-xr-x 4 root root 4096 Mar 8 07:21 hourly.2023-08-12_0405
drwxr-xr-x 4 root root 4096 Mar 8 07:21 hourly.2023-08-12_0505
drwxr-xr-x 4 root root 4096 Mar 8 07:21 hourly.2023-08-12_0605
drwxr-xr-x 4 root root 4096 Mar 8 07:21 hourly.2023-08-12_0705
drwxr-xr-x 4 root root 4096 Mar 8 07:21 hourly.2023-08-12_0805
drwxr-xr-x 4 root root 4096 Mar 8 07:21 weekly.2023-07-30_0015
drwxr-xr-x 4 root root 4096 Mar 8 07:21 weekly.2023-08-06_0015
View snapshots after you connect to the FSx for ONTAP file system through SSH
1. Connect to your file system through SSH. For more information, see Managing file systems with the NetApp ONTAP CLI.
2. Run the following command:
FsxIdabcde::> volume snapshot show
---Blocks---
Vserver Volume Snapshot Size Total% Used%
-------- -------- ------------------------------------- -------- ------ -----
fsx fsx_root
weekly.2023-07-30_0015 2.12MB 0% 52%
weekly.2023-08-06_0015 1.72MB 0% 47%
daily.2023-08-11_0010 192KB 0% 9%
backup-040db63a5fcf46442 1.95MB 0% 50%
daily.2023-08-12_0010 164KB 0% 8%
hourly.2023-08-12_0305 156KB 0% 7%
hourly.2023-08-12_0405 156KB 0% 7%
hourly.2023-08-12_0505 156KB 0% 7%
hourly.2023-08-12_0605 156KB 0% 7%
hourly.2023-08-12_0705 156KB 0% 7%
hourly.2023-08-12_0805 160KB 0% 7%
fsxvol
weekly.2023-07-30_0015 5.76MB 0% 0%
weekly.2023-08-06_0015 4.77MB 0% 0%
daily.2023-08-11_0010 220KB 0% 0%
backup-06515e0f42a04f8ae 3.50MB 0% 0%
daily.2023-08-12_0010 192KB 0% 0%
hourly.2023-08-12_0305 172KB 0% 0%
hourly.2023-08-12_0405 164KB 0% 0%
hourly.2023-08-12_0505 164KB 0% 0%
hourly.2023-08-12_0605 164KB 0% 0%
hourly.2023-08-12_0705 164KB 0% 0%
hourly.2023-08-12_0805 176KB 0% 0%
22 entries were displayed.
Related information
Working with snapshots
Why isn't the .snapshot directory visible in an 'ls -al' output on an NFS client? on the NetApp Knowledge Base