# Understanding Used Space in Capacity Reporter

### Introduction

Total space used displayed in Capacity Reporter can conflict for several reasons.

Total Space Used is calculated using Operating System values, while the total of Space Used by users is calculated by adding together the size of files. These differences cause discrepancies in the totals reported. As file systems get bigger and bigger, the discrepancy can become very large.

AO = | Overhead consumed by Disk Allocation, Volume Managers, and File Systems.
M = | MinFree (Super User Reserved Space) ranging from 1% to 10% of the disk.
DO = | Overhead consumed by directory descriptors.
FO = | Extra space consumed by files due to the cluster group size.
SO = | Overhead consumed by symbolic links and indexes.
FSU = | File Space Used by the files calculated by adding the file sizes.
FS = | Free Space available on the file system.
TC = | Total Capacity of a Disk.

### Solaris Calculations of Total Space Used for File Systems vs Total Space Used by Users of the Same File System

Comparison
Total Space Used for File Systems | Total Space Used by Users of File Systems
Total Space Used = Total capacity* - Free Space | Agent adds up the actual size of files on the file system
*TC = M + DO + FO + SO + FSU + FS (AO not included) | FSU

In Solaris, the output of 'df -k' excludes the MinFree value from Total Space Used and Total Free Space.
For example: If the total capacity of an empty disk is 10 MB, and the minfree setting is 10% (1 MB in this case), the space available values will differ by 1 MB:

- Total space used for file systems = 10 MB - 9 MB = 1 MB
- Total space used by users of file systems, as determined by the agent = 0 MB

### Windows NT Calculations of Total Space Used for File Systems vs Total Space Used by Users of the Same File System

Comparison
Total Space Used for File Systems | Total Space Used by Users of File Systems
NTFS Formatted File Systems
Total Space Used = Total capacity* - Free Space | Agent adds up the actual size of files on the file system
*TC = DO + FO + SO + FSU + FS | FSU
FAT Formatted File Systems
Total Space Used = Total capacity* - Free Space | Agent adds up the actual size of files on the file system
TC = FO + FSU + FS | FSU

NTFS Example:

This can be verified by running chkdsk from the command prompt against the file system in question.

Sample Results from chkdsk:

- 38620259 KB total disk space.

- 8855224 KB in 15683 files. ß This number indicates the space used by files.

- 5260 KB in 1377 indexes. ß This number is considered “system space used”.

- 0 KB in bad sectors.

- 85387 KB in use by the system. ß Some files are only accessible by the OS. This is considered “system space used”.

- 65536 KB occupied by the log file.

- 29674388 KB available on disk.

- 4096 bytes in each allocation unit. <- Cluster Group Size

- 9655064 total allocation units on disk.

- 7418597 allocation units available on disk.

FAT Example:

For any operating system that supports it, the FAT file system uses the following cluster sizes:

       Drive size
       (logical volume)      FAT type   Sectors     Cluster size
       -----------------------------------------------------------------------
           15 MB or less     12-bit       8           4 KB
           16 MB - 127 MB    16-bit       4           2 KB
          128 MB - 255 MB    16-bit       8           4 KB
          256 MB - 511 MB    16-bit      16           8 KB
          512 MB - 1,023 MB  16-bit      32          16 KB
        1,024 MB - 2,048 MB  16-bit      64          32 KB
        2,048 MB - 4,096 MB  16-bit     128          64 KB
       *4,096 MB - 8,192 MB  16-bit     256         128 KB Windows NT 4.0 only
       *8,192 MB - 16384 MB  16-bit     512         256 KB Windows NT 4.0 only

### Capacity Reporter Setting Can Affect Space Used Results for Devices and Users

Capacity Reporter can report different results for space used on a disk, volume, or partition than it reports for space used by users. The used space value differs, depending upon:

- Whether or not file compression is in use on a volume.
- The option chosen in the Capacity Reporter software to "report physical size" or to "report logical size".

In addition, the space used calculations differ:

- Space used by a device is calculated from the agent's report of free space, which reports the actual, physical space used. This total is not affected by the option to "report logical" or "report physical" size of files.
- Space used by a user is calculated by adding either the logical size of all files on the volume or the physical size of all files on the volume, depending on the option selected in the application. If the option is set to report logical size, the space used by users can be greater than the actual, physical size of the files.

So, when file compression is used, and when the option to report logical size is selected, space used by users is often reported as a greater value than space used on the device.

For example, if a device contains compressed and uncompressed files, the calculations vary as follows, depending upon the option setting:

Capacity Reporter Option Setting | Space used by users | Space used by devices | Notes
Report logical size | 1 MB +1 MB = 2 MB | 330 KB + 1 MB = 1.33 MB + Overhead | The combination of file compression and reporting logical size of files often results in a Space used by users value > Space used by devices value
Report physical size | 330 KB + 1 MB = 1.33 MB | 330 KB + 1 MB = 1.33 MB + Overhead | Selecting the option to report physical size of files is much more likely to result in the Space used by users value agreeing with the space used by devices value

### The Size of the SRM Filedata and Dirdata CSV files are not included in the total size of the File System

The CSV files generated for RMS are not included in the total size of the directory because the scan of a file system is a snapshot of the file system and as we work our way through it we scan the root first. If the CSV Files are stored on the root they will be scanned when they are almost empty. You can see the file size from the scan by opening the FileData CSV file. You can compare that number to the actual size of the file in order to find the difference. In order to work around this issue you must create a directory on the root of the File System that is alphabetically at the end of the directories on the root. (i.e. \zz, /zz on UNIX) and RMS should be updated with the directory and file names for the CSV files. In order to add the files to a directory you must first make sure the directory exists on the file systems in the group. Then update the properties page of the file system group with the directory\filename.csv (directory/filename.csv on UNIX) in the File details filename and Directory details filename fields.