How to view snapshots and determine the size of snapshots in 7-Mode
Applies to
- Data ONTAP 7 and earlier
- Data ONTAP 8 7-Mode
Description
- What is the snap list command?
- How do I view snapshots on the filer?
- How do I determine the size of a snapshot?
- How do I see how much space will be regained by deleting a snapshot?
- How do I see the rate of change between snapshots?
Procedure
The snap list command on the filer displays the following information regarding filer snapshots:
- The snapshots that exist on the filer's volumes
- The snapshots that exist on the filer's aggregates (for Data ONTAP 7G)
- The percentage of space used by snapshots in the volume/aggregate
Output of the snap list command appears similar to the following:
fas940-rtp> snap list vol0
Volume vol0
working...
%/used %/total date name
---------- ---------- ------------ --------
3% ( 3%) 0% ( 0%) Mar 03 20:00 hourly.0
8% ( 5%) 0% ( 0%) Mar 01 20:00 hourly.1
11% ( 3%) 0% ( 0%) Mar 01 16:00 hourly.2
11% ( 0%) 0% ( 0%) Mar 01 12:00 hourly.3
11% ( 0%) 0% ( 0%) Mar 01 08:00 hourly.4
11% ( 0%) 0% ( 0%) Mar 01 00:00 nightly.0
13% ( 2%) 0% ( 0%) Feb 29 20:00 hourly.5
Prior to Data ONTAP 7G, the snap list command was the only command available to view the size of a particular snapshot, the amount of space a snapshot was consuming, and the information needed for snapshot reserve planning.
Data ONTAP 7.0 introduced two new commands to simplify snapshot space management. The snap delta and snap reclaimable commands provide information on the snapshot space usage and rate of change between snapshots. The use of these commands is preferred over the snap list command when determining snapshot properties. Details of the snap delta and snap reclaimable commands can be located in the following: Data ONTAP Data Protection Online Backup and Recovery Guide.
Interpreting the data provided by the snap list command:
The %/used column reports the space consumed by snapshots as a percentage of disk space being used in the volume. This column is more useful than the %/total column for planning the snapshot reserve because it is more likely to remain constant as the file system fills.
The "%/total" column reports the space consumed as a percentage of total disk space (both space used and space available) in the system.
Details on how the %/used and %/total values are calculated can be found in "How the snap list output is calculated" section of the Data ONTAP Data Protection Online Backup and Recovery Guide.
Using the snap list output to determine the snapshot reserve requirements:
The cumulative snapshot space from the %/used column of the snap list output can be used to identify the current snapshot space requirements as a percentage of the total volume size. For example, over several weeks, the snap list output is collected for filer toaster /vol/vol0. This output looks similar to:
fas940-rtp> snap list vol0
Volume vol0
working...
%/used %/total date name
---------- ---------- ------------ --------
3% ( 3%) 0% ( 0%) Mar 03 20:00 hourly.0
8% ( 5%) 0% ( 0%) Mar 01 20:00 hourly.1
11% ( 3%) 0% ( 0%) Mar 01 16:00 hourly.2
11% ( 0%) 0% ( 0%) Mar 01 12:00 hourly.3
11% ( 0%) 0% ( 0%) Mar 01 08:00 hourly.4
11% ( 0%) 0% ( 0%) Mar 01 00:00 nightly.0
13% ( 2%) 0% ( 0%) Feb 29 20:00 hourly.5
In this example, the filer toaster is configured to keep 1 nightly and 6 hourly snapshots. This can be confirmed by viewing the snap schedule:
toaster> snap sched vol0
Volume vol0: 0 1 6@8,12,16,20
On looking at the total list of snapshots for vol0, the snap list output shows that the overhead for snapshots is only 13%. Based on this finding, the default snapshot reserve of 20% will most likely never be filled to capacity. Assuming that this pattern of change is constant, a reserve of 12% to 15% should provide a safe margin to ensure that the snapshot usage will not overrun the snap reserve. As such, the snap reserve can be changed to a smaller percentage, which will return some disk space back to the volume for use to store actual file data. To change the snap reserve, run the snap reserve command.
toaster> snap reserve vol0 15
Running the snap delta command to determine the rate of change on a volume:
If the filer is running Data ONTAP 7.0 or later, the snap delta command provides an easy method for determining the rate of data change between snapshots on a volume. This command can be run against a single snapshot, multiple snapshots, or all volumes on the filer. A possible application for this command is planning for SnapMirror updates. For example, if the filer administrator is planning to implement SnapMirror and needs to know the approximate rate of change between snapshot intervals (to estimate the size of the SnapMirror transfers), the snap delta command can be used to see this:
fas940-rtp> snap list vol0
Volume vol0
working...
%/used %/total date name
---------- ---------- ------------ --------
3% ( 3%) 0% ( 0%) Mar 03 20:00 hourly.0
8% ( 5%) 0% ( 0%) Mar 01 20:00 hourly.1
11% ( 3%) 0% ( 0%) Mar 01 16:00 hourly.2
11% ( 0%) 0% ( 0%) Mar 01 12:00 hourly.3
11% ( 0%) 0% ( 0%) Mar 01 08:00 hourly.4
11% ( 0%) 0% ( 0%) Mar 01 00:00 nightly.0
13% ( 2%) 0% ( 0%) Feb 29 20:00 hourly.5
fas940-rtp> snap delta vol0
Volume vol0
working...
From Snapshot To KB changed Time Rate (KB/hour)
-------------- -------------------- ----------- ----------- ---------------
hourly.0 Active File System 3948 0d 01:35 2483.018
hourly.1 hourly.0 20884 1d 23:59 435.158
hourly.2 hourly.1 8712 0d 04:00 2178.000
hourly.3 hourly.2 8624 0d 04:00 2156.000
hourly.4 hourly.3 8640 0d 04:00 2160.000
nightly.0 hourly.4 18164 0d 08:00 2270.421
hourly.5 nightly.0 16352 0d 04:00 4075.546
Summary...
From Snapshot To KB changed Time Rate (KB/hour)
-------------- --------------------- ----------- ---------- ---------------
hourly.5 Active File System 85324 3d 01:35 1159.385
In this example, the rate of change is about 8650 KB per day assuming that one snapshot is taken per day. This excludes the delta between hourly.1 to hourly.0, which is 20884 KB.
Note: Although the delta is between two hourly snapshots (hourly.0 and hourly.1), the time range is 1 day between the two.
Additional information on the snap delta command can be found in the "Displaying the rate of change between Snapshot copies" section of the Data ONTAP Data Protection Online Backup and Recovery Guide.
Running the snap reclaimable command to determine which snapshots to delete:
If the filer is running Data ONTAP 7.0 or later, the snap reclaimable command provides an easy method for determining the amount of space that is freed by the deletion of a snapshot. This command can be run against a single snapshot or multiple snapshots. The snap reclaimable command can take a while to run as it calculates the blocks unique to the snapshot(s) that are being queried.
For example, if a snap list shows the following snapshots on vol0:
fas940-rtp> snap list vol0
Volume vol0
working...
%/used %/total date name
---------- ---------- ------------ --------
3% ( 3%) 0% ( 0%) Mar 03 20:00 hourly.0
8% ( 5%) 0% ( 0%) Mar 01 20:00 hourly.1
10% ( 3%) 0% ( 0%) Mar 01 16:00 hourly.2
11% ( 0%) 0% ( 0%) Mar 01 12:00 hourly.3
11% ( 0%) 0% ( 0%) Mar 01 08:00 hourly.4
11% ( 0%) 0% ( 0%) Mar 01 00:00 nightly.0
13% ( 2%) 0% ( 0%) Feb 29 20:00 hourly.5
The snap reclaimable command can be run to determine the space savings by deleting these snapshots:
fas940-rtp> snap reclaimable vol0 hourly.0 hourly.1
Processing (Press Ctrl-C to exit) ..........
snap reclaimable: Approximately 1328 Kbytes would be freed.
Additional information on the snap reclaimable command can be found in the "Displaying space reclaimed from deleted Snapshot copies" section of the Data ONTAP Data Protection Online Backup and Recovery Guide.
Running the snap list command to determine which snapshots to delete:
The snap list command can be used to determine which snapshot should be deleted to free the most space. The values in parentheses (the values that show the space used by an individual snapshot) are useful in identifying a particular snapshot to remove when the file system is full. However, deleting a particular snapshot does not necessarily release the total amount of space indicated, because other snapshots may be referring to the same blocks. If two adjacent snapshots show little difference in the cumulative values, then most of the data referenced by these snapshots is the same. In this case, deleting one of these snapshots will not free up much space.
The following example demonstrates how the %/used percentages in the snap list output relate to the size of the snapshots and how to determine which snapshots to delete to reclaim the most space.
- No changes have been made to the volume since the creation of snapshots
Filer toaster's /vol/vol0 has 100MB used. Since no data has changed since the snapshot was taken, thesnap listoutput shows:
toaster> snap list
Volume vol0
working...
%/used %/total date name
---------- ---------- ------------ --------
0% ( 0%) 0% ( 0%) Apr 20 08:00 hourly.0
The space used by the hourly.0 snapshot is 0% as no changes have been made to the files in /vol/vol0, so no blocks have changed between the snapshot and the active file system.
- Changes have been made to the volume since the creation of snapshots
At 9:30 AM, one 20MB file is deleted and a new 20MB file is created. At 10:00, a new hourly snapshot is taken. Thesnap listnow displays the following:
toaster> snap list
Volume vol0
working...
%/used %/total date name
---------- ---------- ------------ --------
0% ( 0%) 0% ( 0%) Apr 20 10:00 hourly.0
20% ( 20%) 1% ( 1%) Apr 20 08:00 hourly.1
The hourly.1 snapshot now consumes space because it holds the blocks for the 20MB file that was deleted from the active file system. The hourly.0 snapshot consumes no space as no changes have been made to the volume after the creation of this snapshot.
- Changes have been made to the volume between the snapshot creations.
At 11:30 AM, the 20MB file created at 9:30 AM was deleted. At 12:00 PM, the hourly.0 snapshot was created. Following this activity, thesnap listnow displays the following:
toaster> snap list
Volume vol0
working...
%/used %/total date name
---------- ---------- ------------ --------
0% ( 0%) 0% ( 0%) Apr 20 12:00 hourly.0
17% ( 20%) 1% ( 1%) Apr 20 10:00 hourly.1
33% ( 20%) 2% ( 1%) Apr 20 08:00 hourly.2
In the above output, hourly.2 and hourly.1 both contain 20MB of data that no longer exists in the active file system (AFS). However, they reference different blocks on the filerâ??s disks. The space used by the snapshots is: - Percentage of space used by hourly.1 = 20 %
20MB held in hourly.1 x 100%
20MB in hourly.1 + 80 MB in vol0 AFS
- Space held by hourly.2 = 20%
20MB held in hourly.2 x 100%
20 MB in hourly.2 + 80MB in vol0 AFS
- Cumulative space used by hourly.2 = 33%
(20MB held in hourly.2+20MB held in hourly.1 )x 100%
20 MB in hourly.2 + 20 MB in hourly.1 + 80 MB in vol0 AFS
