This is an old revision of the document!
Recovering from 100% disk usage
The typical symptoms for 100% disk usage are as under :
- When you open a website, it may throw errors like no space is left on the drive or show some error page
- You may get MySQL issues
- Other unexpected or unusual errors
The most likely causes of 100% disk usage are :
- Genuine website and database usage
- Large log files, typically PHP error logs. This from our experience is a very common factor
- Incremental backups - these are onsite backups (i.e. on the VPS itself) which are enabled by default for every VHost/Website. You can disable the same from within N99panel
- N99panel usage - the disk usage to make the N99panel run the way it has to run
- Operating system disk usage
The system disk may not be technically 100% full, but at a certain threshold, the underlying file-system starts reporting 100% usage in order to keep the system running.
In order to find the cause of 100% usage, from within N99panel, you can typically refer to the 'Stats & More…' → 'Disk Stats'. Imp. These disk stats are generated every hour and are not realtime. But the problem is that even the N99panel web interface may not work when system reaches 100% disk usage. Therefore below we advise a solution which can help you resolve 100% disk usage issue at your end
You have to log into N99panel VPS via SSH, using the following parameters
- Port number 2222
- Username - Your N99panel username
- Password - Your N99panel password
Once you have successfully logged in, you can run various commands as detailed below. First time after logging in when you run these commands, you will be prompted to enter your password
Command : wp-cl-spacemgr-disk-usage - It shows the current/real-time disk used in %age terms
wp-cl-spacemgr-disk-usage disk-used
Command : wp-cl-spacemgr-usage-breakup - It shows the output similar to N99panel's Disk Stats interface, but in text mode. This is not real-time.
wp-cl-spacemgr-usage-breakup usage-breakup
Command : wp-cl-spacemgr-usage-genstats - It lets you generate stats. After running the below command, the output presented by the above mentioned command, would be more accurate. Same would also reflect in N99panel's Disk Stats interface.
wp-cl-spacemgr-usage-genstats genstats
Command : wp-cl-spacemgr-list-files - It shows the list of large files. This command has various options
wp-cl-spacemgr-list-files list-files
The above command shows list of files which are above 100 MB (default value)
wp-cl-spacemgr-list-files -s 150 list-files
The above command shows list of files which are above 150 MB
wp-cl-spacemgr-list-files -u user1 list-files
The above command shows list of files user the user directory /home/user1 and which are above 100 MB
wp-cl-spacemgr-list-files -extns "log,zip" list-files
The above command shows a list of files having extension log and zip
Well, we can combine all the above switches to locate files very specifically. Like for example if I need to look for files greater than 50 MB, under /home/user1 and having extension log or zip, the relevant command would be
wp-cl-spacemgr-list-files -u user1 -s 50 -extns "log,zip" list-files
Command : wp-cl-spacemgr-remove-file - It lets you remove a specific file from the system.
wp-cl-spacemgr-remove-file -f /home/user1/test-cl0099-cl0001.pwh-r1.com_public_html/error_log remove-file
Command : wp-cl-spacemgr-list-ibkps - This command shows the disk used for incremental backups for the respective VHost/Website
wp-cl-spacemgr-list-ibkps list
Command : wp-cl-spacemgr-remove-ibkp - This command allows you to purge/remove all the incremental backups for a particular VHost/Website. Also the future incremental backups will be disabled for that VHost/Website unless enabled from within N99panel interface.
wp-cl-spacemgr-remove-ibkp -v test-cl0099-cl0001.pwh-r1.com purge
Command : wp-cl-spacemgr-clear-journal - This command allows you to purge/remove system log files/journal whereby ensuring that only 50 MB is left untouched. The log files can grow again after purge/removal depending upon system usage/configuration
wp-cl-spacemgr-clear-journal clear