This guide explains how to check disk space usage on your server and identify which directories are consuming the most space. Disk space, also known as storage or web space, is essential for hosting content. When a server reaches its full capacity, users may experience errors when accessing websites or logging into cPanel.
- Checking Disk Space Usage
To determine disk space usage on your server, run the following command:df -h
Note: The df command displays the available and used disk space on your system.
Sample Output:
[root@server ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 160G 160G 20K 100% /
- Identifying Disk Usage by Directory
To pinpoint which directories are consuming the most space, use the du command. This command provides a detailed breakdown of disk usage for each directory within the root filesystem:[root@server ~]# du -h --max-depth=1 / 2>/dev/null | sort -hr 160G / 100G /backup 42G /home 8.4G /usr 6.8G /var 2.7G /opt
- Checking Inode Usage
If the inode limit is reached, users will be unable to create new files. To check inode usage, execute:df -i
Sample Output:
[root@server ~]# df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/vda1 988264 985843 2421 100% / Alternatively, you can use the du command to analyze inode usage: [root@server ~]# du --inodes --max-depth=1 / | sort -hr 985843 / 579631 /home 364933 /var 163487 /usr 17238 /opt 11128 /var 3010 /etc 2429 /root
The df and du commands are essential tools for monitoring disk space usage and identifying storage issues on your server. If you encounter any issues while executing these commands, feel free to reach out to our support team. Also, don’t forget to check out our latest web hosting plans for optimized server performance!
Managing disk space? Learn How to Set Default Disk usage Quota for New Packages through WHM