Last week my Proxmox VE host root directory became full which prevented any backups from starting or launching a virtual machine console. I had to find the file or directory consuming the most space. From the Proxmox forum it was suggested to use a software called ncdu.
apt-get install ncdu
ncdu -x /
Will output an human readable directory size results. This made it easier locating which directory or file was using up the most space.
Prevent root file system from getting full on a Proxmox VE host
I wanted a way to get an email notification when my / partition is about to get full. For this I decided to put a quota on my / partition using Webmin’s quota module tool. If you haven’t already installed Webmin you can do it using this guide.
I will install quota.
aptitude install quota
After it has been installed go to Webmin > System > Disk Quotas.
Click on enable quota support for / under action.
Then click enable quotas for /.
When quota has been enabled for the / partition it is time to set limits.
Click on / Users the click on root.
Then set the limits. Below are what I have set.
Send an email notification warning
To enable the mail notification go to the email notifications tab.
When the usage reaches 90% of the soft limit an email notification will be sent to my email address. The notification will be sent every 6 hours until I cut the size usage below the soft limit.
I am also applying the same limits to the root group.
If I wanted to edit the text of the email message notification being sent this could be done by clicking on Module Config.
To make sure the quota limit and email notification is working as intended I made a test by uploading a 77 GB file into /usr/local/src. After it was uploaded the quota system sent me an email notification warning.
Clicking on the disk quota webmin module will show in color the hard drive size which exceeded the limit.