GXCOM Server Linux Server Disk Full: Find Large Files, Clean Logs and Recover Storage Space
Cherry Servers dedicated servers, VPS, GPU servers and bare metal infrastructure

Linux Server Disk Full: Find Large Files, Clean Logs and Recover Storage Space

A Linux server disk full error can interrupt websites, databases, backups, and application deployments. The message “No space left on device” often appears when a filesystem reaches capacity, but it can also indicate exhausted inodes rather than insufficient storage bytes.

Before deleting anything, identify the affected filesystem and understand what consumes its resources. This guide explains safe diagnostic commands, log cleanup, deleted-file recovery, and when upgrading VPS or cloud storage makes sense.

Linux server disk full troubleshooting showing df and du commands, large file detection, log cleanup, inode usage and VPS storage recovery

1. Check Linux Disk Usage with df

Start by checking mounted filesystem capacity:

df -hT

The output shows filesystem type, total capacity, available space, utilization, and mount points. Focus on the filesystem reporting 100% usage rather than assuming the root partition is responsible.

Next, check inode availability:

df -i

Inodes track filesystem objects. Millions of small files can exhaust available inodes even when storage capacity remains. If inode usage is full, deleting a few large files may not resolve the problem.

Record the affected mount point before continuing.

2. Find Large Directories with du

The du command helps locate directories consuming storage. For the root filesystem, run:

sudo du -xhd1 / 2>/dev/null | sort -h

The -x option prevents traversal into other mounted filesystems. Inspect unusually large directories individually, such as /var, /home, or application storage paths.

For example:

sudo du -xhd1 /var 2>/dev/null | sort -h

Do not assume a large directory is disposable. Database files, virtual machine images, and application uploads may contain essential production data.

3. Find Large Files Safely

To locate files larger than 500 MB on the root filesystem, use:

sudo find / -xdev -type f -size +500M \
-printf '%s %p\n' 2>/dev/null | sort -nr | head -20

The first column reports file size in bytes. Review the resulting paths before making changes.

Common storage consumers include archived logs, abandoned backups, container images, database exports, and temporary application files.

Never automatically delete files returned by a size-based search. A large file may be necessary for a running service.

4. Clean Linux Logs Without Breaking Services

System logs can grow rapidly when applications repeatedly report errors. Inspect journal usage:

sudo journalctl --disk-usage

If the journal is unusually large, consider a controlled cleanup:

UltaHost VPS, dedicated servers and cloud hosting solutions
sudo journalctl --rotate
sudo journalctl --vacuum-size=500M

The first command rotates active journal files. The second removes eligible archived journal files according to the specified size target. It does not guarantee that total journal usage immediately falls below 500 MB.

For traditional logs, inspect /var/log and confirm whether logrotate is configured correctly.

Avoid deleting active log files blindly. Fix the underlying error generating excessive logs, or the disk may fill again.

5. Fix Deleted Files Still Using Disk Space

Sometimes df reports a full filesystem while du cannot account for the usage. One possible cause is a deleted file still held open by a running process.

Check with:

sudo lsof +L1

This lists open files with a link count below one, including deleted files still occupying storage.

Identify the responsible service before taking action. A controlled service restart may release the file descriptor, but restarting databases or production applications can interrupt users.

Investigate other explanations for df and du differences, including filesystem metadata, reserved blocks, and inaccessible directories.

6. Investigate Docker and Application Storage

Container images, build caches, volumes, and logs can consume substantial disk space.

For Docker installations, inspect usage:

docker system df

Review unused resources before removing them. Avoid indiscriminate pruning, especially commands that remove volumes, because persistent application data may be lost.

Also inspect application uploads, package caches, database exports, and scheduled backup directories.

If backups are contributing to capacity problems, our VPS Snapshot and Backup Recovery guide explains how to plan recovery storage without relying on a single local copy.

7. Recover Space and Verify Services

After identifying genuinely unnecessary files, remove or archive them through the appropriate application or system maintenance procedure.

Then rerun:

df -hT
df -i

Confirm that free capacity and inode availability have improved. Check web server, database, and application logs for continued errors.

When a full disk causes service failures, restoring free space alone may not repair corrupted transactions or interrupted background tasks. Validate application health and backups before declaring recovery complete.

8. Prevent Future Disk Full Incidents

Set storage alerts before utilization reaches critical levels. Monitor capacity growth, inode consumption, log retention, and backup schedules.

Review recurring growth patterns and establish realistic headroom for database writes, temporary files, package updates, and application deployments.

Storage performance matters as well as capacity. Our NVMe VPS vs SSD Performance guide explains why disk technology, latency, and workload characteristics deserve separate evaluation.

9. When Should You Upgrade VPS Storage?

Consider upgrading when legitimate application data continues growing despite sensible retention policies, or when available storage no longer supports safe operations.

Check whether your hosting plan supports disk expansion, whether filesystem resizing is required, and whether the change involves downtime.

For general purchasing decisions, read our Best VPS Providers comparison.

Evoxt and Hostwinds are relevant for Linux VPS buyers comparing configurations and management options. Contabo VPS/VDS may interest users evaluating storage capacity against overall resource requirements.

Explore Evoxt VPS plans and verify current disk capacity, pricing, and expansion policies before purchasing.

10. Cloud Servers vs Dedicated Storage

Kamatera offers configurable cloud server resources for organizations that need to evaluate capacity and infrastructure flexibility.

Cloudways Managed Cloud Hosting – High Performance, Managed Security, Automatic Backups and Easy Scaling

Cherry Servers provides bare-metal options for workloads requiring greater physical hardware control, such as large databases or storage-intensive applications.

Dedicated hardware does not automatically eliminate capacity planning, filesystem limits, or backup requirements.

Our Dedicated Server vs Cloud Server comparison explains the operational tradeoffs between these deployment models.

Frequently Asked Questions

Why Is Linux Disk Full After Deleting Files?

Deleted files may remain open in running processes. Check lsof +L1 and investigate filesystem accounting before restarting services.

Can Linux Run Out of Inodes?

Yes. Large numbers of small files can exhaust inodes even when disk capacity remains available. Check using df -i.

Should I Delete Everything in /var/log?

No. Logs are important for troubleshooting and security. Use controlled rotation and retention policies instead of indiscriminate deletion.

Final Verdict

When a Linux server disk is full, start with df, locate large directories with du, investigate files with find, and check logs and open deleted files.

Recover space carefully, verify application health, and establish monitoring. If legitimate storage demand exceeds your plan, compare VPS, cloud, and dedicated infrastructure based on actual capacity, performance, and recovery requirements.

For broader infrastructure selection, consult our Bare Metal Server Comparison before committing to physical hardware.

© GXCOM.NET. All content on this website represents independent research, editorial analysis, and original insights from our team. Any reproduction, quotation, or redistribution must credit the original source and include a link to the original article.https://www.gxcom.net/linux-server-disk-full/
Hostwinds cloud servers, VPS hosting and dedicated server solutions DediXLAB Windows VPS, Linux VPS, dedicated and hybrid servers
Next Post
Linux server disk full troubleshooting showing df and du commands, large file detection, log cleanup, inode usage and VPS storage recovery

No more posts

Subscribe
Notify of
guest
0 Comment
Oldest
Newest Most Voted
返回顶部
0
Would love your thoughts, please comment.x
()
x