From time to time, you may experience an error when trying to view your website, log in to cPanel, or check your email.
Sometimes this is because your server has reached its disk space limits, and new files can no longer be created or written to.
To check the overall disk usage on your server, you can use the following command: df -h
The output will look similar to this:
[root@server ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 160G 160G 20K 100% /
However, you should also monitor your inode usage. If you hit 100% inode usage, you won't be able to create new files or directories and would experience the same behavior as if you used all available disk space.
To check the overall inode usage on your server, you can use the following command: df -i
The output will look similar to this:
[root@server ~]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/vda1 988264 985843 2421 100% /
The df command will let you know if you are nearing your disk's limits. However, you probably want to see where all of your disk space or inodes are being consumed.
To track down where the usage is, you can use the du command.
The following du command will breakdown the disk usage for each directory within / and keep it easy to read.
[root@server ~]# du -h --max-depth=1 / | sort -hr
160G /
100G /backup
42G /home
8.4G /usr
6.8G /var
2.7G /opt
You can also use du to view inode usage.
[root@server ~]# du --inodes --max-depth=1 / | sort -hr
985843 /
579631 /home
364933 /home
163487 /usr
17238 /opt
11128 /var
3010 /etc
2429 /root
Using df and du will be your best method to find the disk usage when you only have access via SSH. For more information on how to manage your hard drive space, please check out our cPanel Docs: https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-manage-your-hard-drive-space/
Comments
0 comments
Article is closed for comments.