Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments

Deleting snapshots

How to determine which snapshots to delete on the basis of size  Top

You can use the snap list command output to determine which snapshots to delete to free the most disk space.

In Sample snap list command output, the cumulative disk space used by snapshots gradually increases from top to bottom.

For example, in the %/used column, the cumulative space used by hourly.1 is 2% and the cumulative space used by hourly.2 is 3%. This is not always the case.

Before trying to conserve space by deleting a large snapshot file, examine the cumulative values in the snap list output. If two adjacent snapshot files show little difference in their cumulative values, most of the data referenced by these snapshots is the same. In this case, deleting only one of the snapshots does not free much disk space.

In many cases, you can use the default snapshot schedule and the default snapshot reserve because these settings are appropriate for most environments. When you create a new volume on a filer, the new volume inherits the snapshot schedule from the root volume. After you use the volume for several days, check how much disk space the snapshots are consuming in the volume. If the amount seems high, decrease the amount of time that snapshots are kept or increase the snapshot reserve.

As you use snapshots, continue to watch the statistics change over time. The statistics help you gain a better understanding of how snapshots use disk space.

Caution
As a general rule, avoid deleting snapshots that are not the product of the snap sched command (for example, snapshots generated by SnapMirror or SnapVault commands). Deleting these snapshots could halt the SnapMirror or SnapVault processes. An exception would be snapshots left over from old SnapMirror relationships that you no longer want to maintain. See Releasing partners from a SnapMirror relationship.

Deleting a snapshot manually  Top

The snap sched command deletes obsolete regularly scheduled snapshots automatically; however, you might want to delete a snapshot before the preset interval to increase disk space or because it is a manual snapshot that is no longer needed but is not going to be automatically deleted.

To delete a snapshot manually from a specific volume, complete the following step.

Step

Action

1

Enter the following command:

snap delete volume_name snapshot_name

volume_name is the name of the volume that contains the snapshot to delete.

snapshot_name is the specific snapshot to delete.

Note
To delete all snapshots on a volume, use the -a parameter: snap delete -a volume_name

Deleting a snapshot manually if the snapshot is locked  Top

If a snapshot is locked, the snap delete operation fails until you execute a snapmirror release (see How to release a source from a SnapMirror relationship) or snapvault release (see Releasing SnapVault relationships) command to unlock the snapshot. Snapshots are locked because SnapMirror or SnapVault is maintaining them for the next update. Deleting a locked snapshot would prevent SnapMirror or SnapVault from correctly replicating a file or volume as specified in the schedule you set up.

Example of how to delete a locked SnapMirror snapshot  Top

The following example shows how you would delete a SnapMirror snapshot that was locked because SnapMirror needed it for an update.

filerA> snap delete vol0 oldsnap
Can't delete oldsnap: snapshot is in use by snapmirror.
Use 'snapmirror destinations -s' to find out why.
filerA> snapmirror destinations -s vol0
Path        Destination
/vol/vol0   filerB:vol0
filerA> snapmirror release vol0 filerB:vol0
filerA> snap delete vol0 oldsnap

Example of how to delete a locked SnapVault snapshot  Top

The following example shows how you would delete a SnapVault snapshot that was locked because SnapVault needed it for an update.

filerA> snap delete vol0 oldsnap
Can't delete oldsnap: snapshot is in use by snapvault.
Use 'snapvault status -l' to find out why.

 
filerA> snapvault status -l 
SnapVault client is ON.
Source:                     filerA:/vol/vol0/qt3 
Destination                 filerB:/vol/sv_vol/qt3 
....

 
filerA> snapvault release /vol/vol0/qt3 filerB:/vol/sv_vol/qt3

 
filerA> snap delete vol0 oldsnap

Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments