25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

Need help?

Our experts have had an average response time of 11.43 minutes in March 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

How to fix Disk Quota Exceeded error in Linux servers

by | May 30, 2018

Disk Quota Exceeded is a common error in Linux web hosting servers. Website owners see this error when they try to upload a file, send a mail or update a database.

Every month, our engineers resolve hundreds of “Disk Quota Exceeded” errors in our role as website support for web hosting companies. We’ve seen these 2 causes for the error:

  1. Users exceeding their mail or web space quota
  2. Corrupted disk quota table
  3. File limit (inode) exhaustion

Today, we’ll take a look at how to troubleshoot, fix and prevent quota exceeded errors.

Fixing mail/web space overage

About 80% of disk quota exceeded errors occur due to users uploading files beyond their subscription limit.

In many cases, we’ve found large files (such as backup, videos, DB dumps, etc.) in the user’s home directory itself. But there are other locations that are not so obvious:

  1. Trash or Spam mail folders
  2. Catch-all mail accounts
  3. Web app log files (eg. WordPress error log)
  4. Old log files (eg. access_log.bak)
  5. Old uncompressed backups (from a previous site restore for eg.)
  6. Un-used web applications

It’s not easy to find these space files if you look at a web panel report. That is why we use Linux command line tools (such as du) to list all directories in a user’s account, and sort them as per size.

Once we’ve found the top directories, we drill down until we locate all non-essential files.

disk space listing - disk quota exceeded

 

[ Never let disk quota errors affect your website functioning. Get our professional help to fix your website errors at affordable pricing. ]

Special case – User’s files located outside home directory

In self-managed VPS servers, we’ve found user files stored outside the user’s home directory. This could be from past troubleshooting steps, incomplete site restore, etc.

We’ve found such files in /usr, /var, / or in some cases even in /root directory.

We resolve this issue by searching the whole file system with the username, deleting them, and then updating the quota table.

Pro Tip : All this detective work takes time. Business mails coming in during this period will bounce. So, if you’re a shared web host, increase the quota by 100 MB temporarily so that services to the user is immediately restored.

Fixing cPanel disk quota cache error

In cPanel servers, even after a disk quota exceeded error is resolved, the web panel shows the old disk space info. That is, even if a 1 GB file is deleted, the space usage doesn’t show any difference.

It is caused by a cPanel feature called “disk quota cache”. cPanel stores disk usage info for 15-30 mins, to reduce disk access, and thereby keep down server load.

To fix this, our tech support team uses two approaches:

  1. In powerful servers, we disable this cache (choose off), as server load isn’t affected.
  2. In heavily loaded or less powerful servers, we educate the users via custom tool tips in the panel that the correct value will be reflected in 15 mins.

Disable disk cache in cPanel - disk quota exceeded

 

How to prevent space overage

Disk space overage results in customers losing their business mails, or websites being down. We’ve been able to reduce the incidence of such downtime in web hosting companies by sending “Disk Quota Warning” emails with specific steps on what to check, and how to delete excess files.

How to fix incorrect quota table

Linux servers store quota information in files such as aquota.user, aquota.group, .quota.user, etc.

In some situations, such as a server crash or hard disk errors, these files could get corrupted, leading to many users getting quota related errors.

When we see a sudden surge in mail or web quota errors for many users at once, we immediately check the quota table. In general, we follow these steps:

  1. Disable quota for the affected partition (usually /home in web hosting servers)
  2. Stop services such as mail, web and FTP that can write new files
  3. Recreate the quota table using the “quotacheck” command (or fixquota in cPanel servers)
  4. Re-enable quota for the affected partition

Pro Tip : A damaged quota table indicates a more serious underlying problem such as a failing hard disk. When such situations, we scan the server for health or security issues. In many cases, we’ve prevented major downtimes by finding and correcting serious server errors.

[ Are you stuck due to no disk space? Get assistance from our server experts to fix your website issues permanently. ]

Resolving file limit (inode) exhaustion

Our engineers provide tech support for several VPS hosting providers. In these companies, the majority of disk quota exceeded errors caused by VPSs hitting file number limit.

Linux servers use something called inodes to keep track of each file. The trouble is, each server (or VPS) has only a limited number of inodes. So, when all inodes are used up by a malicious activity (eg. a spam attack), new files cannot be created.

Here are a few common causes for iNode exhaustion:

  1. Thousands of un-delivered spam mails filling up the mail queue.
  2. Several versions of un-compressed backups
  3. Catch-all mail boxes that accumulated years worth of mails
  4. Old cache files of some programs such as “eAccelerator”
  5. PHP session files that are not automatically deleted

Since VPS users have administrator (root) access, these files could be anywhere. So, we use a top-down scan to find out which folders have the max number of files.

For eg. If /home partition is 100% full, we’d start the scan at /home – like this:

inode usage listing - disk quota exceeded

Then the scan is repeated on the top directory, and the process repeated until we find and delete the junk files.

Pro Tip : At 100% inode usage, all services would be virtually stuck. So, as soon as you login, move a few non-critical folders (like old log files) to another partition to immediately restore services. This will prevent mails bouncing, site errors, etc.

Are you having recurrent issues in your hosting servers? Looking for an expert intervention to stabilize your servers? Click here to know how we can help you make things better.

 

var google_conversion_label = "Blp0CLCojHIQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF