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

Monitoring disk space

Command to use  Top

You use the df [option] [pathname] 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, respectively. You can use the -h option to let Data ONTAP scale the size to the appropriate format, based on the value. You can also use the -r option, which is explained in the next section.

What the command output displays  Top

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:

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. This is because the additional space used by snapshots is also counted in the used space of the active file system.

Effect of LUN and snapshot operations on disk space  Top

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.

Examples of disk space monitoring  Top

The following examples illustrate how to monitor disk space when you create LUNs in various scenarios. They do not include every step required to configure the filer or to perform tasks on the host.

In the examples, assume that the filer is named toaster and the host is named solaris_host, and that two HBAs are installed in the host, lpfc0 (WWPN: 10000000c92f6cd0) and lpfc1 (WWPN:10000000c92f6a24).

Monitoring disk space without using snapshots

The following example illustrates how to monitor disk space on a volume when you create a LUN without using snapshots. For the purpose of this example, assume that you require less than the minimum amount of volume capacity based on the NetApp recommendation of creating a seven-disk volume.

For simplicity, assume the LUN only requires 3 GB of disk space. The information from Guidelines for calculating the size of a volume recommends that the volume size be 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.

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 LUNs because snap reserve is set to 20% by default.

Filesystem              kbytes   used       avail   reserved     Mounted on
/vol/volspace         50119928   1440    50118488          0    /vol/volspace/
/vol/volspace/.snapshot 12529980       0     12529980           0    /vol/volsp ace/.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/vols pace/.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 solaris /vol/volspace/lun0

toaster> df -r /vol/volspace

Result

The following sample output is displayed. 3 GB of space is used because this is the amount of space specified for the LUN, and space reservation is enabled by default.

Filesystem             kbytes      used       avail   reserved   Mounted on
/vol/volspace/       62649908   3150268    59499640          0  /vol/volspace/
/vol/volspace/.snapshot        0          0           0           0  /vol/volsp ace/.snapshot
4

Create an igroup named sol-igroup1 and map the LUN to it by entering the following commands (assuming that your host has an HBA whose WWPN is 100000002bcc92). Depending on your host, you might need to create WWNN persistent bindings. These commands have no effect on disk space.

toaster> igroup create -f -t solaris sol-igroup1 10:00:00:00:2b:cc:92
toaster> lun map /vol/volspace/lun0 sol-igroup1 0

5

From the host, discover the LUN, format it, make the file system available to the host, and write data to the file system. For information about these procedures, see the SAN Host Attach Kit Installation and Setup Guide that came with your SAN Host Attach Kit. These commands have no effect on disk space.

6

From the filer, ensure that creating the file system on the LUN and writing data to it has no effect on space on the filer by entering the following command:

toaster> df -r /vol/volspace

Result

The following sample output is displayed. From the filer, the amount of space used by the LUN remains 3 GB.

Filesystem          kbytes          used      avail   reserved    Mounted on
/vol/volspace/      62649908     3150268    59499640        0    /vol/volspace/
/vol/volspace/.snapshot    0              0           0           0    /vol/vol space/.snapshot
7

Turn off space reservations and see the effect on space by entering the following commands:

toaster> lun set reservation /vol/volspace/lun0 disable

toaster> df -r /vol/volspace

Result

The following sample output is displayed. The 3 GB of space for the LUN is no longer reserved, so it is not counted as used space; it is now available space. Any other requests to write data to the volume can occupy all the available space, including the 3 GB that the LUN expects to have. If the available space is used before the LUN is written to, writes to the LUN fail. To restore the reserved space for the LUN, turn space reservations on.

Filesystem            kbytes     used       avail   reserved     Mounted on
/vol/volspace/      62649908      144    62649584          0     /vol/volspace/
/vol/volspace/.snapshot      0         0            0           0     /vol/vols pace/.snapshot

Monitoring disk space using snapshots

The following example illustrates how to monitor disk space on a volume when taking snapshots. Assume that you start with a new volume and the LUN requires 3 GB of disk space. The information from Guidelines for calculating the size of a volume recommends that the volume size be approximately 2*3 GB plus delta. Assuming the amount of change is small, delta would be minimal, so using two 72 GB disks should still provide more than enough space.

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 SAN or 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 s pace/.snapshot
2

Set the percentage of snap reserve space to zero by entering the following command:

toaster> snap reserve volspace 0

3

Create a LUN (/vol/volspace/lun0) by entering the following commands:

toaster> lun create -s 6g -t solaris /vol/volspace/lun0

toaster> df -r /vol/volspace

Result

The following sample output is displayed. Approximately 6 GB of space is taken from available space and is displayed as used space for the LUN:

Filesystem             kbytes      used       avail   reserved   Mounted on
/vol/volspace/       62649908   6300536    56169372          0  /vol/volspace/
/vol/volspace/.snapshot        0          0           0           0  /vol/volsp ace/.snapshot
4

Create an igroup named sol-igroup1 and map the LUN to the igroup by entering the following commands. These commands have no effect on disk space.

toaster> igroup create -f -t solaris sol-igroup1 10:00:00:00:2b:cc:92
toaster> lun map /vol/volspace/lun0 sol-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, see the SAN Host Attach Kit Installation and Setup Guide that came with your SAN Host Attach Kit. These commands have no effect on disk space.

6

From the host, write data to the file system (the LUN on the filer). This has no effect on disk space.

7

Take a snapshot named snap1 of the active file system, write 1 GB of data to it, 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 first snapshot reserves enough space to overwrite every block of data in the active file system, so you see 12 GB of used space, the 6-GB LUN (which has 1 GB of data written to it), and one snapshot. Notice that 6 GB appears in the reserved column to ensure writes to the LUN do not fail. If you disable space reservation, this space is returned to available space.

Filesystem        kbytes          used         avail   reserved   Mounted on
/vol/volspace/    62649908    12601072      49808836    6300536  /vol/volspace/
/vol/volspace/.snapshot   0          180               0           0  /vol/vols pace/.snapshot
8

From the host, write another 1 GB of data to the LUN. Then, from the filer, observe the effect on disk space by entering the following commands:

toaster> df -r /vol/volspace

Result

The following sample output is displayed. The amount of data stored in the active file system does not change. You just overwrote 1 GB of old data with 1 GB of new data. However, the snapshot requires the old data to be retained. Before the write, there was only 1 GB of data, after the write, there is 1 GB of new data and 1 GB of data in a snapshot. Notice that the used space goes up for the snapshot by 1 GB and the available space for the volume goes down by 1 GB.

Filesystem           kbytes       used        avail   reserved   Mounted on
/vol/volspace/     62649908    12601072    47758748         0   /vol/volspace/
/vol/volspace/.snapshot   0     1050088           0         0   /vol/volspace/. snapshot
9

Take a snapshot named snap2 of the active file system and observe the effect on disk space by entering the following command:

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.

toaster> snap create volspace snap2

Result

The following sample output is displayed. Because the first snapshot reserved enough space to overwrite every block, only 44 blocks are used to account for the second snapshot.

Filesystem          kbytes     used          avail        reserved   Mounted on
/vol/volspace/    62649908    12601072    47758748     6300536   /vol/volspace/
/vol/volspace/.snapshot  0     1050136           0           0   /vol/volspace/ .snapshot
10

From the host, write 2 GB of data to the LUN and observe the effect on disk space by entering the following command:

toaster> df -r /vol/volspace

Result

The following sample output is displayed. The second write requires the amount of space actually used if it overwrites data in a snapshot.

Filesystem          kbytes       used      avail    reserved   Mounted on
/vol/volspace/    62649908   12601072    4608427     6300536   /vol/volspace/
/vol/volspace/.snapshot  0    3150371          0           0   /vol/volspace/.s napshot

Monitoring disk space using backing store LUNs and LUN clones  Top

The following example illustrates how to monitor disk space on a volume when taking snapshots, using backing store LUNs and LUN clones. Assume that you start with a new volume and the LUN requires 3 GB of disk space. The information from Guidelines for calculating the size of a volume recommends that the volume size be approximately 4*3 GB plus delta. Assuming that the amount of change is high, delta would be 20%, so using two 72 GB disks should still provide more than enough space.

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 SAN or 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 space /.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/vols pace/.snapshot
3

Create a LUN (/vol/volspace/lun0) and observe the effect on disk space by entering the following commands:

toaster> lun create -s 12g -t solaris /vol/volspace/lun0

toaster> df -r /vol/volspace

Result

The following sample output is displayed. Approximately 12 GB 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                                0  /vol/volspace/
/vol/volspace/.snapshot        0          0           0           0  /vol/volsp ace/.snapshot
4

Create an igroup named sol-igroup1 and map the LUN to the igroup by entering the following commands. These commands have no effect on disk space.

toaster> igroup create -f -t solaris sol-igroup1 10:00:00:00:2b:cc:92
toaster> lun map /vol/volspace/lun0 sol-igroup1 0

5

From the host, discover the LUNs, format them, and make the file system available to the host. For information about on these procedures, see the SAN Host Attach Kit Installation and Setup Guide that came with your SAN Host Attach Kit. These commands have no effect on disk space.

6

From the host, write data to the file system (the LUN on the filer). This has no effect on disk space.

7

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

8

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

9

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: solaris
     Maps: sol-igroup1=0
/vol/volspace/snaplun             3g (3221225472)      (r/w, online)
     Serial#: 0dDICn1RRA0J
     Backed by: /vol/volspace/.snapshot/snap1/lun0
     Share: none
     Space Reservation: enabled
     Multiprotocol Type: solaris
     Maps: sol-igroup1=0
10

Create a clone of the backing store LUN you created in Step 8 and observe the effect on disk space by entering the following commands:

toaster> lun clone start /vol/volspace/snaplun

toaster> df -r /vol/volspace

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