Monitoring disk space
Command to use
You use the df [option] [] command to monitor the amount of free disk space that is available on one or all volumes on a filer. The amount of space is displayed in 1,024-byte blocks by default. You use the -k, -m, -g, or -t options to have space displayed in KB, MB, GB, or TB format, or you can use the -h option to let Data ONTAP scale the size to the appropriate format, based on the value. The -r option is explained below.
What the command output displays
The output of the df command displays four columns of statistics about the active file system in the volume and the snapshot directory for that volume. The statistics displayed are as follows:
- Amount of total space on the volume, in the size of bytes you specific
Total space = used space + available space
- Amount of used space
Used space = space storing data + space storing snapshots + space storing reserved space
- Amount of available space
Available space = space that is not used or reserved, it is free space
- Percentage of the volume capacity being used
The -r option changes the last column to report on the amount of reserved space, that is, how much of the used space is reserved for writing data to existing LUNs.
In the statistics displayed for the snapshot directory, the sum of used space and available space can be larger than the total space for that volume because the extra space used by snapshots is accounted for in the used space of the active file system.
The effect of LUN and snapshot operations on disk space
The following table illustrates the effect on disk space when you create a volume, create a LUN, write data to the LUN, take snapshots of the LUN, and expand the size of the volume.
For this example, assume that space reservation is enabled and snap reserve is set to 0%.
Action
|
Result
|
Comment
|
Create a 100-GB volume.
|
Used space = 0 GB Reserved space = 0 GB Available space = 100 GB Volume Total: 100 GB
Snapshot creation is allowed.
|
N/A
|
Create a 40-GB LUN on that volume.
|
Used space = 40 GB Reserved space = 0 GB Available space = 60 GB Volume Total: 100 GB
Snapshot creation is allowed.
|
Used space is 40 GB for the LUN.
If the LUN size was limited to accommodate at least one snapshot when it was created, it will always be less than one half of the volume size.
|
Write 40 GB of data to the LUN.
|
Used space = 40 GB Reserved space = 0 GB Available space = 60 GB Volume Total: 100 GB
Snapshot creation is allowed.
|
The amount of used space does not change because with space reservations set to On, the same amount of space is used when you write to the LUN as when you created the LUN.
|
Create a snapshot of the LUN.
|
Used space = 80 GB Reserved space = 40 GB Available space = 20 GB Volume Total: 100 GB
Snapshot succeeds.
|
The snapshot locks all the data on the LUN so that even if that data is later deleted, it remains in the snapshot until the snapshot is deleted.
As soon as a snapshot is created, the reserved space must be large enough to ensure that any future writes to the LUN succeed. Reserved space is now 40 GB, the same size of the LUN. Data ONTAP always displays the amount of reserved space required for successful writes to LUNs.
Because reserved space is also counted as used space, used space is 80 GB.
|
Overwrite all 40 GB of data on the LUN with new data.
|
Used space = 100 GB Reserved space = 40 GB Available space = 0 GB Volume Total: 100 GB
Snapshot creation is blocked.
|
Data ONTAP manages the space so that the overwrite increases used space to 100 GB and decreases available space to 0. The 40 GB for reserved space is still displayed.
You cannot take another snapshot because no space is available. That is, all space is used by data or held in reserve so that any and all changes to the content of the LUN can be written to the volume.
|
Expand the volume by 100 GB.
|
Used space = 120 GB Reserved space = 40 GB Available space = 80 GB Volume Total: 200 GB
Snapshot creation is allowed.
|
After you expand the volume, the amount of used space displays the amount needed for the 40 GB LUN, the 40 GB snapshot, and 40 GB of reserved space.
Free space becomes available again, so snapshot creation is no longer blocked.
|
Overwrite all 40 GB of data on the LUN with new data.
|
Used space = 120 GB Reserved space = 40 GB Available space = 80 GB Volume Total: 200 GB
Snapshot creation is allowed.
|
Because none of the overwritten data belongs to a snapshot, it disappears when the new data replaces it. As a result, the used total remains unchanged.
|
Create a snapshot of the LUN.
|
Used space = 160 GB Reserved space = 40 GB Available space = 40 GB Volume Total: 200 GB
Snapshot creation is allowed.
|
The snapshot locks all 40 GB of data currently on the LUN. The used space is the sum of 40 GB for the LUN, 40 GB for each snapshot, and 40 GB for reserved space.
|
Overwrite all 40 GB of data on the LUN with new data.
|
Used space = 160 GB Reserved space = 40 GB Available space = 40 GB Volume Total: 200 GB
Snapshot creation is allowed.
|
Because the data being replaced belongs to a snapshot, it remains on the volume.
|
Expand the LUN by 40 GB.
|
Used space = 200 GB Reserved space = 40 GB Available space = 0 GB Volume Total: 200 GB
Snapshot creation is blocked.
|
The amount of used space increases by the amount of LUN expansion.
The amount of reserved space remains at 40 GB.
Because the available space has decreased to 0, snapshot creation is blocked.
|
Delete both snapshots of the volume.
|
Used space = 80 GB Reserved space = 0 GB Available space = 120 GB Volume Total: 200 GB
Snapshot creation is allowed.
|
The 80 GB of data locked by the two snapshots disappears from the used total when the snapshots are deleted. Because there are no more snapshots of this LUN, the reserved space decreases to 0 GB.
Snapshot creation is once again allowed.
|
Delete the LUN.
|
Used space = 0 GB Reserved space = 0 GB Available space = 200 GB Volume Total: 200 GB
|
Because no snapshots exist for this volume, deletion of the LUN causes the used space to decrease to 0 GB.
|
Example of monitoring disk space
The following example illustrates how to use the df -r command to monitor disk space on a volume when you perform the following tasks:
- Create a volume
- Create a LUN
- Write data to the LUN
- Take a snapshot
- Create a backing store LUN
- Create a clone of the backing store LUN
For simplicity, assume that the amount of disk space required for the original LUN is 3 GB. The information from Guidelines for calculating the size of a volume recommends that the volume size be approximately four times 3 GB plus the amount of change expected between snapshots. Assuming this rate is approximately 3 GB plus 10%. If you plan to use 72 GB disks (which typically results in 67.9 GB of physical capacity, depending on the manufacturer), two disks provide more than enough space, one for data and one for parity.
This example does not include every step required to configure the filer or to perform tasks on the host.
In the example, the filer is named toaster, and the node name for the Windows host is iqn.1991-05.com.microsoft:eng1.
To work through the example, complete the following steps.
Step
|
Action
|
|
1 |
From the filer, create a new volume named volspace that has approximately 67 GB and observe the effect on disk space by entering the following commands:
toaster> vol create volspace 2
toaster> df -r /vol/volspace
Result
The following sample output is displayed. There is a snap reserve of 20% on the volume even though the volume will be used for iSCSI LUNs.
Filesystem kbytes used avail reserved Mounted on
/vol/volspace 50119928 1440 50118488 0 /vol/volspace/
/vol/volspace/.snapshot 12529980 0 12529980 0 /vol/vol spa
ce/.snapshot
|
|
2 |
Set the percentage of snap reserve space to zero and observe the effect on disk space by entering the following commands:
toaster> snap reserve volspace 0
toaster> df -r /vol/volspace
Result
The following sample output is displayed. The amount of available snapshot space becomes zero, and the 20% of snapshot space is added to available space for /vol/volspace.
Filesystem kbytes used avail reserved Mounted on
/vol/volspace/ 62649908 1440 62648468 0 /vol/volspace/
/vol/volspace/.snapshot 0 0 0 0 /vol/vol spa
ce/.snapshot
|
|
3 |
Create a LUN (/vol/volspace/lun0) and observe the effect on disk space by entering the following commands:
toaster> lun create -s 3g -t windows /vol/volspace/lun0
toaster> df -r /vol/volspace
Result
The following sample output is displayed. Approximately 3GB of space is taken from available space and is displayed as reserved space for the LUN:
Filesystem kbytes used avail reserved Mounted on
/vol/volspace/ 62649908 3150268 59499640 0 /vol/volspace/
/vol/volspace/.snapshot 0 0 0 0 /vol/volspace
/.snapshot
|
|
4 |
Create an igroup named win-igroup1 and map the LUN to the igroup by entering the following commands (assuming the node name is iqn.1991-05.com.microsoft:eng1). These commands have no effect on disk space.
toaster> igroup create -i -t windows win-igroup1 iqn.1991-05.com.microsoft:eng1 toaster> lun map /vol/volspace/lun0 win-igroup1 0
|
|
5 |
From the host, discover the LUNs, format them, and make the file system available to the host. For information about these procedures for your host initiator, see the documentation provided with your iSCSI host Initiator Support Kit or with your SAN Host Attach Kit for iSCSI Protocol on your host.
|
|
6 |
From the filer, see that there is a minimum effect on used and available space after creating the file system on the LUN by entering the following command.
toaster> df -r /vol/volspace
Result
The following sample output is displayed:
Filesystem kbytes used avail reserved Mounted on
/vol/volspace/ 62649908 3150324 59499584 0 /vol/volspace/
/vol/volspace/.snapshot 0 0 0 0 /vol/volspace/
.snapshot
|
|
7 |
From the host, write data to the file system (the LUN on the filer).
|
|
8 |
From the filer, see the effect of writing to the LUN by entering the following command:
toaster> df -r /vol/volspace
Result
The following sample output is displayed:
Filesystem kbytes used avail reserved Mounted on
/vol/volspace/ 62649908 3150324 59499584 0 /vol/volspace/
/vol/volspace/.snapshot 0 0 0 0 /vol/volspace/.
snapshot
|
|
9 |
From the host, continue writing data to the file system until the LUN is full.
Again, there is no effect.
Result
The following sample output is displayed:
Filesystem kbytes used avail reserved Mounted on
/vol/volspace/ 62649908 3150324 59499584 0 /vol/volspace/
/vol/volspace/.snapshot 0 0 0 0 /vol/volspace/.
snapshot
|
|
10 |
Take a snapshot named snap1 of the active file system and observe the effect on disk space.
Caution From the host or the application, ensure that the active file system is in a quiesced or synchronized state prior to taking a snapshot.
Enter the following commands:
toaster> snap create volspace snap1
toaster> df -r /vol/volspace
Result
The following sample output is displayed. The amount of reserved space increases to approximately 3 GB to ensure that in addition to being able to write data to the LUN, data in the snapshot can be overwritten as well because when Data ONTAP writes to a block of data in a snapshot, both the old data and the new data must be stored. In this example, 722 KB of space is used for the snapshot.
Filesystem kbytes used avail reserved Mounted on
/vol/volspace/ 62649908 6036168 56613740 2884368 /vol/volspace/
/vol/volspace/.snapshot 0 180 0 0 /vol/volspace/.sn
apshot
|
|
11 |
Create a backing store LUN0 named snaplun and observe the effect on disk space by entering the following commands:
toaster> lun create -b /vol/volspace/.snapshot/snap1/lun0 /vol/volspace/snaplun
Note After you create this LUN, you must go through the same procedure on the host to discover the new LUN, format it, and so on, except for creating a new file system on it.
toaster> df -r /vol/volspace
Result
The following sample output is displayed. The amount of reserved space increases to approximately 6 GB to ensure that both LUNs can be written to, and a small amount of space is increased for the snapshot.
Filesystem kbytes used avail reserved Mounted on
/vol/volspace/ 62649908 9185024 53464884 2884392 /vol/volspace/
/vol/volspace/.snapshot 0 150 0 0 /vol/volspace/
.snapshot
|
|
12 |
Display the status of both LUNs by entering the following command:
toaster> lun show -v
Result
The following sample output is displayed:
/vol/volspace/lun0 3g (3221225472) (r/w, online, mapped)
Serial#: 0dDICn1A-Z0J
Share: none
Space Reservation: enabled
Multiprotocol Type: windows
Maps: win-igroup1=0
/vol/volsapce/snaplun 3g (3221225472) (r/w, online)
Serial#: 0dDICn1RRA0J
Backed by: /vol/volspace/.snapshot/snap1/lun0
Share: none
Space Reservation: enabled
Multiprotocol Type: windows
Maps: win-igroup1=0
|
|
13 |
Create a clone of the backing store LUN you created in step 11 and observe the effect on disk space by entering the following commands:
toaster> lun clone start /vol/volspace/snaplun
toaster> df -r /vol/volspace
Result
The following sample output is displayed. The amount of used space increases to 45 GB, available space decreases, and again, a small amount of space is used by snapshot.
Filesystem kbytes used avail reserved Mounted on
/vol/volspace/ 62649908 9290128 53359780 2989448 /vol/volspace/
/vol/volspace/.snapshot 0 196 0 0 /vol/volspace/.s
napshot
|
Copyright © 1994-2003, Network Appliance, Inc. All rights
reserved.
Part No. 210-00571
File: c3lun-i4.htm
Last updated: 11/21/03 17:05:22