Data Domain - Checking for Snapshots that are No Longer Needed
Summary: Checking for Snapshots that are No Longer Needed
Symptoms
Snapshots are a great tool for managing data. They are fast and use very little disk space on the Data Domain system. However, if there is a Snapshot of data and you try to delete the data, very little space will be freed up until the Snapshot expires. This KB article provides instructions for listing and expiring Snapshots for DD OS versions both pre-5.0 and 5.0 and later.
Cause
Resolution
The Snapshot command manages file system snapshots. A Snapshot is a read-only copy of the entire Data Domain file system from the top-level. Snapshots are useful for avoiding version skew when backing up volatile data sets, such as tables in a busy database, and for retrieving earlier versions of a directory or file that was deleted. Snapshots can be scheduled to occur on a specific frequency, and can set to expire in the future (the default retention of a snapshot is 14 days).
- If the Data Domain system is a source for collection replication, Snapshots are replicated.
- If the Data Domain system is a source for directory replication, Snapshots are not replicated; they must be created separately on a directory replication destination.
- In DD OS versions 4.3 - 4.9, Snapshots are created in the system directory: /backup/.snapshot. Each directory under /backup also has a Snapshot directory with the name of each Snapshot that includes the directory.
In DD OS versions 5.0 and later, MTrees have been introduced and change how Snapshots are handled:
- The Data Domain file system can have more than one MTree
- Each MTree can have their own managed Snapshot(s) and schedule(s).
- The default MTree in 5.0 is /data/col1/backup/, where the Snapshot would be created in /data/col1/backup/.snapshot.
The filesys fastcopy command can use Snapshots to copy a file or directory tree from a Snapshot to the active file system.
Note: Filesys fastcopy can create a Snapshot of file(s) that have a retention period of one hour.
Warning: Do not manually expire Snapshots on a replicated destination, as this will cause replication errors in syncing the source to the destination.
For Data Domain Systems using DD OS 5.0.x.x and later:
- Identify which MTree to examine:
mtree list
Name Pre-Comp (GiB) Status ----------------- -------------- ------ /data/col1/backup 95.0 RW /data/col1/test 0.0 RW ----------------- -------------- ------ D : Deleted RO : Read Only RW : Read Write RD : Replication Destination RLE : Retention-Lock Enabled RLD : Retention-Lock Disabled
- In the case above, /data/col1/backup contains 95GB. We can run the following to see if there are any Snapshots present:
snapshot list mtree <mtree> sysadmin@DD670# snapshot list mtree /data/col1/backup Snapshot Information for MTree: /data/col1/backup ---------------------------------------------- Name Pre-Comp (GiB) Create Date Retain Until Status ----- -------------- ----------------- ----------------- ------ snap1 49.7 Apr 19 2011 10:44 snap2 49.7 Apr 19 2011 10:45 snap3 94.8 Apr 19 2011 11:05 snap4 95.0 Apr 19 2011 11:05 snap5 100.7 Apr 19 2011 11:09 May 24 2011 11:09 ----- -------------- ----------------- ----------------- ------
Snapshot Summary ------------------- Total: 5 Not expired: 5 Expired: 0
- Expire the Snapshot:
snapshot expire <snapshot> mtree <mtree path> sysadmin@DD670# snapshot expire snap1 mtree /data/col1/backup Snapshot "snap1" for mtree "/data/col1/backup" will be retained until Apr 19 2011 11:11. (The command will set the retention to the current date and time, thereby expiring the dataset)
- Repeat the steps for the remaining snapshots intended for expiration. Then check the list and confirm:
snapshot list mtree <mtree> snapshot list mtree /data/col1/backup Snapshot Information for MTree: /data/col1/backup ---------------------------------------------- Name Pre-Comp (GiB) Create Date Retain Until Status ----- -------------- ----------------- ----------------- ------- snap1 49.7 Apr 19 2011 10:44 Apr 19 2011 11:11 expired snap2 49.7 Apr 19 2011 10:45 Apr 19 2011 11:15 expired snap3 94.8 Apr 19 2011 11:05 Apr 19 2011 11:15 expired snap4 95.0 Apr 19 2011 11:05 Apr 19 2011 11:15 expired snap5 100.7 Apr 19 2011 11:09 Apr 19 2011 11:15 expired ----- -------------- ----------------- ----------------- ------- Snapshot Summary ------------------- Total: 5 Not expired: 0 Expired: 5
Note: When Snapshots are expired, they will be removed upon next completion of the clean cycle.