Check Disk Usage under Linux

The list of mounted file systems with disk quota enabled can be obtained using the command

quota -v

The meaning of the the columns in the output is as follows:

Value Description
Filesystem The mounted file system, usually in the form <server>:/<directory>. Use df <directory> to determine the mounted file system for a given directory
blocks Used disk space in kilobytes
quota Soft limit for disk usage (you can still write new files or data when exceeded but only until the grace time is up)
limit Hard limit for disk usage (you cannot write new files or data any more when exceeded)
grace The grace time indicates the time left to remove data when you exceed the soft quota (when this time is up you cannot write new files or data any more)
file Number of files
quota Soft limit for number of files (you can still write new files when exceeded but only until the grace time is up)
limit Hard limit for number of files (you cannot write new files any more when exceeded)
grace The grace time indicates the time left to delete files when you exceed the soft quota (when this time is up you cannot write new files any more)

Example:

> quota -v
Disk quotas for user walteste (uid 50515):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
fs.www.inf.ethz.ch:/export/services/www/d1/home
                 110668  40000000 45000000            6511       0       0      
fs.www.inf.ethz.ch:/export/services/www/d1/site
                 110668  40000000 45000000            6511       0       0      

Nagging Quota

For file systems on iiStore an additional nagging quota may be active. This quota is not enforced technically but you (and your ITC) are informed by mail when your nagging disk quota on a particular file system is exceeded. For more information see here.

The nagging disk quota limits can be viewed in your user account details for your group here.

Disk Usage

For file systems without quota an alternative, slower and less accurate method to measure the used disk space is to use

du -sh <directory>

To count the number of files and directories you can use

find <directory> | wc -l

Example:

> du -sh /local
42G     /local
> find /local | wc -l
97093

Available Disk Space

The total available disk space on a file system can be determined using

df -h <directory>

CIFS file systems on the ITS NAS do not show the available disk space if quotas are enabled. Instead the disk quota is shown.

Example:

> df -h /home/walteste
Filesystem            Size  Used Avail Use% Mounted on
fs.www.inf.ethz.ch:/export/services/www/d1/home
                      498G  244G  255G  49% /home


Page URL: https://isg.inf.ethz.ch/bin/view/Main/HelpStorageCheckDiskUsageLinux
2024-12-21
© 2024 Eidgenössische Technische Hochschule Zürich