Operations 8 min read

DirectAdmin Disk Usage at 100%? Find and Clear It Fast

A disk at 100% is not gradual, everything that writes to it starts failing at once: mail queues, backups, log files, even DirectAdmin's own interface.

By BashPilot Team
BashPilot AI server management One request plans, executes and verifies the fix, on every server. See pricing

A DirectAdmin server hitting 100% disk usage does not fail gracefully. Mail delivery stops mid-message, backups fail partway through leaving corrupt archives, MySQL can refuse writes entirely, and DirectAdmin's own admin interface can become unresponsive since it needs to write session and log data too. The priority is finding what is actually consuming the space fast, not guessing from account sizes alone.

Check DirectAdmin's own usage accounting first

Before reaching for generic Linux disk tools, check whether DirectAdmin's own numbers are even current. DirectAdmin tracks per-account usage through a setting called realtime_quota in /usr/local/directadmin/conf/directadmin.conf, which controls how that figure gets calculated: 2 uses live kernel-level quotactl calls, 1 uses a slower binary-based calculation, and 0 updates usage only on a nightly tally. On a server set to 0, the admin panel and User Usage figures can be up to a day stale, which alone explains a lot of confusing disk-full incidents where the numbers just do not add up.

force an immediate recalculation instead of waiting for the nightly tally
echo "action=quotatally&value=all" >> /usr/local/directadmin/data/task.queue

For a single account instead of the whole server, target it directly: echo "action=quotatally&value=USERNAME&type=user" >> /usr/local/directadmin/data/task.queue. Either command gets picked up by DirectAdmin's task queue processor (dataskq) within moments, not on the next scheduled cycle. If the recalculation itself fails silently, check /var/log/directadmin/errortaskq.log for the reason before assuming the new number is accurate.

Then confirm what is full at the filesystem level

With DirectAdmin's own numbers ruled out or refreshed, move to the filesystem directly. A server can have plenty of free space on one partition while another (commonly / or /home) is completely full.

check disk usage per filesystem
df -h

If df and a manual du calculation disagree significantly at this level, that is a separate, filesystem-level issue from anything DirectAdmin's accounting would show.

check for deleted files still held open by a process
lsof +L1

A non-empty result here means a process (very often a log rotation gone wrong, or a crashed application still holding a large file handle) has a deleted file still consuming space because something has not released its file descriptor. Restarting that specific process, not deleting more files, is the actual fix in this case.

Find the largest consumers

With that ruled out or confirmed, find out where the space is actually going, starting broad and narrowing down.

largest directories under /home, one level deep
du -h --max-depth=1 /home/ 2>/dev/null | sort -rh | head -20

This ranks accounts by size fast. For the top offenders, go one level deeper to find the specific culprit inside that account.

drill into a specific account
du -h --max-depth=2 /home/USERNAME/ 2>/dev/null | sort -rh | head -20
Common locationTypical cause
public_html/wp-content/uploads/Unoptimized media, or a compromised account being used as file storage
logs/ inside the accountVerbose error logging left enabled long-term, or an attack generating massive access logs
.trash/ or DirectAdmin's own backup retention foldersOld backups or deleted files retained far longer than intended
A MySQL data directory under /var/lib/mysqlA runaway table, often from unbounded logging into a database table, or an unoptimized InnoDB file that never shrinks automatically

Check the usual server-level suspects too

Do not stop at hosted account content, server-level logs and system files are a common cause that a per-account scan will miss entirely.

check system log and package cache sizes
du -sh /var/log/*
du -sh /var/cache/*

A mail log (/var/log/maillog or /var/log/exim_mainlog) that has grown to gigabytes is common on a server that has dealt with a spam incident or a sustained attack, since every rejected connection attempt gets logged too. Package manager caches (apt, yum/dnf) can also grow surprisingly large on a server that has not been cleaned in a long time.

safely clear package manager cache
apt-get clean   # Debian/Ubuntu
dnf clean all    # AlmaLinux/Rocky/CentOS

Clear space safely, in the right order

  1. 1

    Restart any process holding deleted file handles

    If lsof +L1 showed anything significant, restart that specific service to actually release the space rather than deleting more files first.

  2. 2

    Rotate and compress oversized logs rather than deleting them outright

    logrotate -f /etc/logrotate.conf forces an immediate rotation, or manually gzip a specific oversized log if you need the historical content retained but compressed.

  3. 3

    Clean confirmed-safe caches and old backups

    Package manager caches and backup retention older than your actual policy requires are the safest space to reclaim first, with the least risk of breaking anything.

  4. 4

    Address the specific account only after the above

    If a single account's content is the genuine cause, contact the account owner before deleting anything that might be legitimate data rather than assuming it is safe to remove.

Working through this checklist correctly under time pressure, with mail and backups already failing, is exactly when it is easiest to trust a stale DirectAdmin number or delete the wrong thing. BashPilot forces a live quota recalculation, cross-checks it against actual filesystem usage, and confirms what is safe to clear before removing anything.

In BashPilot

Finding the cause of a sudden disk fill

app.bashpilot.com
disk is at 100% on directadmin01, mail and backups are failing, but DirectAdmin shows accounts only using 60%
BashPilot

That gap is expected, DirectAdmin's totals only cover what it attributes to accounts. Forced a fresh quota tally and checked the filesystem directly: /var/log/exim_mainlog has grown to 41GB from a spam incident 4 days ago, well outside anything DirectAdmin tracks.

CheckResult
DirectAdmin account totals (after fresh tally)62%, accurate
Actual filesystem usage (df)100%
/var/log/exim_mainlog41GB
rotate that log and confirm space is actually freed
BashPilot

Rotating exim_mainlog and confirming exim is writing to the new file before removing the old one. Rechecking free space afterward before declaring this resolved.

bash
logrotate -f /etc/logrotate.d/exim4
df -h /
Example output, not a screenshot of a specific customer's server.

Try this on one of your own servers.

Start free trial

Verify the fix actually holds

Freeing space once does not confirm the underlying cause is addressed, especially if logging or backup retention is what caused it originally.

confirm usage and watch the trend
df -h /
watch -n 3600 'df -h / >> /var/log/disk-trend.log'

If usage climbs back toward capacity within days rather than the weeks or months it took to get there originally, the actual cause (an attack still ongoing, a log rotation still misconfigured, a runaway database table) was not fully resolved, only the symptom was.

Prevent it happening again

  • Set a disk usage alert well below 100%, at 80% or 85%, so you have time to investigate calmly instead of reacting to mail and backups already failing.
  • Confirm logrotate is actually running successfully on a schedule, a silently failing rotation is one of the most common root causes of a slow, unnoticed fill.
  • Move backup retention offsite or to separate storage rather than keeping months of local backups on the same disk the live server depends on.
Share LinkedIn X
Questions

Frequently asked questions

Why does DirectAdmin show lower disk usage than the actual server disk usage?

DirectAdmin's totals only cover what it can attribute to a hosted account, plus MySQL databases, Apache-owned files and mailing list data. Server-level logs, package caches and anything outside the account structure are invisible to it, so the actual filesystem (`df -h`) can read 100% while DirectAdmin's own per-account totals only add up to a fraction of that. This is expected, not a bug.

How do I force DirectAdmin to recalculate disk usage instead of waiting for the nightly tally?

Add a task queue entry: `echo "action=quotatally&value=all" >> /usr/local/directadmin/data/task.queue` for every account, or swap `all` for a specific username with `&type=user` appended to recalculate just one. This is picked up within moments by DirectAdmin's task queue processor rather than waiting for the scheduled nightly tally, which is what the `realtime_quota=0` setting relies on by default.

Why do df and du show different disk usage numbers at the filesystem level?

This mismatch almost always means a process is still holding a deleted file open, so the space has not actually been released back to the filesystem even though the file no longer appears in any directory listing. Run `lsof +L1` to find the specific process, then restart it to actually free the space. This is separate from DirectAdmin's own account-level accounting.

How do I find what is filling up disk space on a DirectAdmin server?

Run `du -h --max-depth=1 /home/ | sort -rh` to rank hosted accounts by size, then drill into the largest ones with `--max-depth=2` to find the specific directory. Also check `/var/log` and `/var/cache` directly, server-level logs and package caches are a common cause that neither a per-account scan nor DirectAdmin's own usage totals will show.

Is it safe to delete old log files to free disk space?

Only if you use `logrotate -f` or truncate in place, not a plain delete, since a service still writing to that file will not actually release the space until it is restarted, and deleting it directly can also disrupt the service's ongoing logging. Compress and archive logs you need to keep rather than removing them outright.

Can a full disk cause DirectAdmin's own interface to stop working?

Yes. DirectAdmin needs to write session data, logs and temporary files of its own to function, so a completely full disk can make the admin interface unresponsive or throw errors, independent of any issue with hosted accounts specifically.

What disk usage percentage should trigger an alert on a DirectAdmin server?

Around 80 to 85% is a reasonable threshold for most servers, giving enough headroom to investigate and clear space calmly before hitting the point where mail, backups and writes start failing outright at 100%. Adjust lower if the server's disk usage tends to grow quickly between checks.

Put your servers on autopilot.

Connect a server in about a minute. The first week is on us.