How to find what is using the most disk space on my server InMotion Hosting ContributorUpdated on September 25, 2024 4 Minute Read If you notice you are not able to connect to your cPanel, Webmail, or WHM and your website is slow and giving errors, your server may be maxed out on the disk space. A common error you may see is like the following when going to your cPanel. Sorry for the inconvenience! The filesystem mounted at / on this server is running out of disk space. cPanel operations have been temporarily suspended to prevent something bad from happening. Please ask your system admin to remove any files not in use on that partition. Important! This is for VPS or Dedicated server customers only. If you are getting this error and you are not on a VPS or a Dedicated server, you will need to contact tech support to have our systems support check the server disk space. You can check your Disk space usage through shell or you can check the disk space through the WHM. The purpose of this article is to show you how to check the disk space through shell. How to view your overall disk size and usage Checking disk space through Shell You can check your disk space usage through the Shell Command line by typing the following command in your shell client. df -h You will get a similar to the following output. root@vps#### [~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/vzfs 39G 38G 858M 98% / none 512M 4.0K 512M 1% /dev This Output shows that out of the 39 gigs of total disk space, 38 gigs are used with 858mb of space left over. This leaves the server at 98% disk space. This is enough to cause cPanel login failures, FTP file upload errors, and slow website issues. At this point you will need to remove some of the files from the server to bring the server back to normal operation. Using the Web Host Manager If you are not familiar with using command line, you can look at your disk space usage through the WHM . The WHM will show you the accounts with the highest usage. For more information on checking your Disk space through WHM, see our article on How to Monitor Disk Space and Bandwidth Usage in WHM. Unfortunately, you cannot remove files through the WHM, you will need to access the cPanel File Manager for the account that has the large disk space usage and remove the files / folder through File manager. How to find files with a certain size There are two commands you can use to check which folder files are taking up your disk space. You can use the “find” or the “du” command. Below explains the two commands you can use. Important! You must have permission to access the files you are searching for. If not you will get permissions errors. Finding all file sizes with the “du” command The following command will display all files and folders sorted by MegaBytes. du --max-depth=1 | sort -n | awk 'BEGIN {OFMT = "%.0f"} {print $1/1024,"MB", $2}' You should see an output of all your folders with the size of them in megabytes similar to the following: 0 MB ./.htpasswds 0 MB ./.trash 0 MB ./public_ftp 0 MB ./etc 0 MB ./.fontconfig 0 MB ./.cpanel 0 MB ./mail 4 MB ./tmp 1173 MB ./public_html 1224 MB . This output shows that all files over 1 MB are in the /public_html. You can run this command on a directory basis to find folders that are large. Also, this command can be customized to refne your search. Finding specific file sizes using the “find” command Below is the “find“command that looks for specific files in the “home” directory. The following script is finding files that are 500000k or larger find /home -type f -size +500M -exec du -h {} \; The previous command will output a similar result like the following. /home/userna5/public_html/error_log: 514M /home/userna5/backup-userna5.tar.gz: 738M Here you can see that there is a backup that is 738MB large. You can find your backup files that are no longer needed and remove them to free up space. If you cannot fix the disk space issue on your server, you can have tech support look into the matter for you. If you do not have any space to free up and cannot find files to remove, you can always upgrade your hosting plan to a plan with a larger disk. Share this Article Related Articles How Can I View My CPU Usage in cPanel? How to Stress Test Your Website How to find what is using the most disk space on my server What is Excessive Server Resource Usage and How to Fix it Understanding Caching Understanding Server Loads Large Surges in Traffic Going to a Site Not Optimized for High Traffic Advanced Server Load Monitoring How to Create a Website Stress Testing Plan NGINX Basics For Debian Server