It is important to understand the amount of disk space snapshots consume and the amount of disk space they are likely to consume. The following sections explain how to determine the amount of disk space used by snapshots.
Suppose a snapshot contains a 1-MB file that hasn't changed since the filer created the snapshot. If that file is removed from the active file system, the snapshot then consumes 1 MB of disk space.
The same version of that 1-MB file might be referenced by several snapshots: hourly.0, hourly.1, and hourly.2. If these snapshots all contain the 1-MB file that hasn't changed since the filer created those snapshots, only 1 MB of disk space is consumed by the snapshots even though all three snapshots contain the file.
To provide information about snapshot disk utilization, the df command on the filer treats snapshots as a partition different from the active file system.
Following is a partial sample df command output:
df
Filesystem kbytes used avail capacity
/vol/vol0 3000000 2000000 1000000 65%
/vol/vol0/.snapshot 1000000 500000 500000 50%
Note: The numbers in this example were rounded off to make the example easier to understand. Also, to make the output easier to read, the "Mounted on" column is not included in the sample df output in the following sections.
In this example, the vol0 volume contains 4 GB of disk space. It has 1 GB (or 25%) reserved for snapshots (the idea of reserving space for snapshots is described in more detail later). That leaves 3 GB for the active file system, and 2 GB of the file system is in use.
It is important to understand that the /vol/vol0/.snapshot line counts data that exists only in a snapshot. Because data that also exists in the active file system needs to be stored on disk anyway, it is misleading if the filer charged the space to snapshots. In the example, half of the 1 GB reserved for the snapshot is used.
By default, the snapshot reserve is 20% of disk space. For information about how to adjust the amount of the snapshot reserve, refer to "Changing the snapshot reserve."
This section uses several examples to explain the advantages of reserving disk space for snapshots.
If the filer created a snapshot when the disks were full, removing files from the active file system wouldn't create any free space because everything in the active file system would also be referenced by the newly created snapshot. The filer would have to delete the snapshot before it could create any new files.
The following example shows how disk space being freed by deleting files in the active file system ends up in the snapshot:
If the filer creates a snapshot when the active file system is full and there is still space remaining in the snapshot reserve, the df command output is as follows:
Filesystem kbytes used avail capacity
/vol/vol0/ 3000000 3000000 0 100%
/vol/vol0/.snapshot 1000000 500000 500000 50%
If you remove 100 MB of files, the disk space used by these files is no longer part of the active file system, so the space is reassigned to the snapshots instead. If you enter the df command, the output is as follows:
Filesystem kbytes used avail capacity
/vol/vol0/ 3000000 2900000 100000 97%
/vol/vol0/.snapshot 1000000 600000 400000 60%
The filer reassigns 100 MB of space from the active file system to the snapshot reserve. Because there was reserve space for snapshots, removing files from the active file system freed space for new files.
Even with the snapshot reserve, the job of administering snapshot disk space consumption is important. There is no way to prevent snapshots from consuming disk space greater than the amount reserved for them. Consider what would happen in the example if all files in the active file system were deleted. Before the deletion, the df output was as follows:
Filesystem kbytes used avail capacity
/vol/vol0/ 3000000 3000000 0 100%
/vol/vol0/.snapshot 1000000 500000 500000 50%
After removing all the data in the file system, the df command generates the following output:
Filesystem kbytes used avail capacity
/vol/vol0/ 3000000 2500000 500000 83%
/vol/vol0/.snapshot 1000000 3500000 0 350%
The entire 3 GB in the active file system moved into snapshots, along with the 500 MB that were in snapshots before, making a total of 3.5 GB of snapshot data. This is 2.5 GB more than the space reserved for snapshots. Because the active file system cannot use that space, the space shows up as used by the active file system even though no files are there.
Whenever snapshots consume more than 100% of the snapshot reserve, the system is in danger of becoming full. In this case, you can create files only after you remove enough snapshots.
For example, if 500 MB of data were added to the active file system in the preceding example, a df command generates the following information:
Filesystem kbytes used avail capacity
/vol/vol0 3000000 3000000 0 100%
/vol/vol0/.snapshot 1000000 3500000 0 350%
As soon as the filer creates a new snapshot, every block in the system is referenced by some snapshot. Therefore, no matter how many files you remove from the active file system, there is still not room to add any more. The only way to recover from this situation is to remove enough snapshots to free more disk space. Refer to "Displaying snapshot statistics" for information about how to use the snap list command to determine which snapshot to delete.
Quotas do not count disk space consumed by snapshots. If snapshots were included in the quota calculations, users could end up in a state where they could not create any new files until all snapshots containing their old files expired.
Copyright © 1999, Network Appliance, Inc. All rights reserved.
Part No. 210-02334
File: snap3.htm
Last updated: 04/26/99 08:11:44