Difference in space usage displayed by ONTAP quota reports and UNIX clients
The value of used disk space displayed in a quota report for a FlexVol volume or qtree can be different from the value displayed by a UNIX client for the same volume or qtree. The difference in these values is because of the different methods followed by the quota report and the UNIX commands for calculating the data blocks in the volume or qtree.
For example, if a volume contains a file that has empty data blocks (to which data is not written), the quota report for the volume does not count the empty data blocks while reporting the space usage. However, when the volume is mounted on a UNIX client and the file is shown as the output of the ls command, the empty data blocks are also included in the space usage. Therefore, the ls command displays a higher file size when compared to the space usage displayed by the quota report.
Similarly, the space usage values shown in a quota report can also differ from the values shown as a result of UNIX commands such as df and du.
How a quota report accounts for disk space and file usage
The number of files used and the amount of disk space specified in a quota report for a FlexVol volume or a qtree depend on the count of the used data blocks corresponding to every inode in the volume or the qtree.
The block count includes both direct and indirect blocks used for regular and stream files. The blocks used for directories, Access Control Lists (ACLs), stream directories, and metafiles do not get accounted for in the quota report. In case of UNIX sparse files, empty data blocks are not included in the quota report.
The quota subsystem is designed to consider and include only user controllable aspects of the filesystem. Directories, ACLs, and snapshot space are all examples of space excluded from quota calculations. Quotas are used to enforce limits, not guarantees, and they only operate on the active filesystem. Quota accounting does not count certain filesystem constructs, nor does it account for storage efficiency (such as compression or deduplication).
Learn more about the commands described in this procedure in the ONTAP command reference.
Disparity between ls command and quota report for space usage
When you use the ls command to view the contents of a FlexVol volume mounted on a UNIX client, the file sizes displayed in the output could differ from the space usage displayed in the quota report for the volume depending on the type of data blocks for the file.
The output of the ls command displays only the size of a file and does not include indirect blocks used by the file. Any empty blocks of the file also get included in the output of the command.
Therefore, if a file does not have empty blocks, the size displayed by the ls command might be less than the disk usage specified by a quota report because of the inclusion of indirect blocks in the quota report. Conversely, if the file has empty blocks, then the size displayed by the ls command might be more than the disk usage specified by the quota report.
The output of the ls command displays only the size of a file and does not include indirect blocks used by the file. Any empty blocks of the file also get included in the output of the command.
Example of the difference between space usage accounted by the ls command and a quota report
The following quota report shows a limit of 10 MB for a qtree q1:
----Disk---- ----Files----- Quota Volume Tree Type ID Used Limit Used Limit Specifier ------- -------- ------ ------- ----- ----- ------ ------ --------- vol1 q1 tree user1 10MB 10MB 1 - q1 ...
A file present in the same qtree can have a size exceeding the quota limit when viewed from a UNIX client by using the ls command, as shown in the following example:
[user1@lin-sys1 q1]$ ls -lh -rwxr-xr-x 1 user1 nfsuser **27M** Apr 09 2013 file1
Learn more about ls in the ONTAP command reference.
Learn how the df command accounts for file size
The way in which in the df command reports the space usage depends on two conditions: whether the quotas are enabled or disabled for the volume that contains the qtree, and if quota usage within the qtree is tracked.
When quotas are enabled for the volume that contains the qtree and quota usage within the qtree is tracked, the space usage reported by the df command equals the value specified by the quota report. In this situation, quota usage excludes blocks used by directories, ACLs, stream directories, and metafiles.
When quotas are not enabled on the volume, or when the qtree does not have a quota rule configured, the reported space usage includes blocks used by directories, ACLs, stream directories, and metafiles for the entire volume, including other qtrees within the volume. In this situation, the space usage reported by the df command is greater than the expected value reported when quotas are tracked.
When you run the df command from the mount point of a qtree for which quota usage is tracked, the command output shows the same space usage as the value specified by the quota report. In most cases, when the tree quota rule has a hard disk-limit, the total size reported by the df command equals the disk limit and the space available equals the difference between the quota disk limit and quota usage.
However, in some cases, the space available reported by the df command might equal the space available in the volume as a whole. This can occur when there is no hard disk limit configured for the qtree. Beginning with ONTAP 9.9.1, it can also occur when the space available in the volume as a whole is less than the remaining tree quota space. When either of these conditions occur, the total size reported by the df command is a synthesized number equal to the quota used within the qtree plus the space available in the FlexVol volume.
|
|
This total size is neither the qtree disk limit nor the volume configured size. It can also vary based on your write activity within other qtrees or on your background storage efficiency activity. |
Example of space usage accounted by the df command and a quota report
The following quota report shows a disk limit of 1 GB for qtree alice, 2 GB for qtree bob, and no limit for qtree project1:
C1_vsim1::> quota report -vserver vs0
Vserver: vs0
----Disk---- ----Files----- Quota
Volume Tree Type ID Used Limit Used Limit Specifier
------- -------- ------ ------- ----- ----- ------ ------ ---------
vol2 alice tree 1
502.0MB 1GB 2 - alice
vol2 bob tree 2
1003MB 2GB 2 - bob
vol2 project1 tree 3
200.8MB - 2 - project1
vol2 tree * 0B - 0 - *
4 entries were displayed.
In the following example, the output of the df command on qtrees alice and bob reports the same used space as the quota report, and the same total size (in terms of 1M blocks) as the disk limit. This is because the quota rules for qtrees alice and bob have a defined disk limit and the volume available space (1211 MB) is greater than the tree quota space remaining for qtree alice (523 MB) and qtree bob (1045 MB).
linux-client1 [~]$ df -m /mnt/vol2/alice Filesystem 1M-blocks Used Available Use% Mounted on 172.21.76.153:/vol2 1024 502 523 50% /mnt/vol2 linux-client1 [~]$ df -m /mnt/vol2/bob Filesystem 1M-blocks Used Available Use% Mounted on 172.21.76.153:/vol2 2048 1004 1045 50% /mnt/vol2
In the following example, the output of the df command on qtree project1 reports the same used space as the quota report, but the total size is synthesized by adding the available space in the volume as a whole (1211 MB) to the quota usage of qtree project1 (201 MB) to give a total of 1412 MB. This is because the quota rule for qtree project1 has no disk limit.
linux-client1 [~]$ df -m /mnt/vol2/project1 Filesystem 1M-blocks Used Available Use% Mounted on 172.21.76.153:/vol2 1412 201 1211 15% /mnt/vol2
The following example shows how the output of the df command on the volume as a whole reports the same available space as project1.
linux-client1 [~]$ df -m /mnt/vol2 Filesystem 1M-blocks Used Available Use% Mounted on 172.21.76.153:/vol2 2919 1709 1211 59% /mnt/vol2
Learn more about the commands described in this procedure in the ONTAP command reference.
Disparity betwee du command and quota report for space usage
When you run the du command to check the disk space usage for a qtree or FlexVol volume mounted on a UNIX client, the usage value might be higher than the value displayed by a quota report for the qtree or volume.
The output of the du command contains the combined space usage of all the files through the directory tree beginning at the level of the directory where the command is issued. Because the usage value displayed by the du command also includes the data blocks for directories, it is higher than the value displayed by a quota report.
Example of the difference between space usage accounted by the du command and a quota report
The following quota report shows a limit of 10MB for a qtree q1:
----Disk---- ----Files----- Quota Volume Tree Type ID Used Limit Used Limit Specifier ------- -------- ------ ------- ----- ----- ------ ------ --------- vol1 q1 tree user1 10MB 10MB 1 - q1 ...
In the following example, the disk space usage as the output of the du command shows a higher value that exceeds the quota limit:
[user1@lin-sys1 q1]$ du -sh **11M** q1
Learn more about the commands described in this procedure in the ONTAP command reference.