How can I free up the space consumed by snapshots?
How can I free up the space consumed by snapshots?
Details
The space consumption of a snapshot is not a fixed number but varies depending on whether or not the data of your shared folders and LUNs are modified. In fact, snapshot files themselves are very small, it is the data blocks preserved by snapshots that are taking up volume space. Before guiding you through how to check the space consumption of a snapshot and free up volume space by deleting snapshots, this article will first explain the principle of snapshots.
Resolution
How snapshots work
A snapshot records the state of a shared folder or LUN at a particular point of time by pointing to data blocks. Individual blocks are preserved instead of whole files to minimize the space consumption of the snapshot file. So when a file is changed or deleted, its snapshots will consume extra space because the original blocks are still kept as part of one or more snapshots, and the changes will be stored on new blocks. When you delete a file, its snapshots still point to the data blocks of the file, so as long as the snapshots are not deleted, these blocks still consume volume space. As a result, the older a snapshot is, the more space it may take up. The following illustration shows more clearly of the aforementioned principle:
As shown in the illustration, here is a file of 48 KB divided into three data blocks, each of which 16 KB, for instance. When you take a snapshot for this file, these blocks are preserved. Later when you modify this file and the modification is on block C, a new block C' will store the change as the original block C is already preserved by the snapshot. Then, when you delete the snapshot without having made any other changes to the file, you can thereby free up 16 KB of space that was previously taken up by block C, while the file remains 48 KB the whole time. In the future, as more changes are made to this file, more data blocks will be preserved by snapshots, and simply deleting the file does not remove the data blocks that are parts of the snapshots.
Freeing up volume space by deleting snapshots
To check the space consumption of snapshots:1
- Go to Snapshot Replication > Snapshots.
- Select a shared folder and click Snapshot > Calculate Size.
- Select a time range no shorter than a week by specifying the start and end date. You can see the number of snapshots taken within the selected time frame.
- Click Calculate Now to start calculating.
- After the calculation is complete, you can check the estimated size by clicking the arrow beside the shared folder. The estimation indicates the size of the data blocks preserved by the snapshots taken during the time range.
To delete snapshots:
- Select a shared folder or LUN and click Snapshot List.
- Select one or more snapshots from the list and click Remove. By deleting all snapshots taken during the time range you set for snapshot size calculation, you will be able to free up the space.2,3
Notes:
- The system supports only the calculation of shared folders' snapshots.
- If you do not want to delete all snapshots within the time range, you are advised to delete older ones as they may point to data blocks that belong to files that no longer exist and thus can free up more space.
- Because space reclamation runs periodically, after you delete the snapshots, the space they took up will not be released immediately. On DSM 7.0 and above, you can configure the space reclamation schedule in Storage Manager.