Linux Disk Space Is Full: Diagnose Before Deleting Files

A full filesystem can break database writes, sessions, logs, updates, and even SSH operations. The first task is to identify which filesystem is full and whether the issue is capacity or inode exhaustion.

Use df -h to inspect space and df -i to inspect inode usage. Then identify large directories with du, starting from the affected mount. Deleted files may still consume space when a process has them open; lsof can help locate those handles. Do not delete unfamiliar database files or active service files to recover space quickly.

Logs, backups, cache directories, container layers, and old releases are common sources of growth. Establish which files are safe to rotate or remove, and preserve at least one known-good backup outside the filesystem being cleaned. Check retention policies before deleting backups that may be the only recovery point.

After cleanup, verify the service that failed and add monitoring or retention limits. A recurring disk alert is easier to handle than an emergency cleanup while production writes are failing.

  • 2 Comments
  • 11 Views
  • Share:

2 Comment

image
Webguru Dev Lab 1 week ago

Check inodes as well as gigabytes. A cache containing hundreds of thousands of tiny files can exhaust inodes while df -h still shows free space.

image
Webguru Security Desk 1 week ago

If a deleted log is still held open, restart or reload the owning service only when safe; deleting more files will not release that space.

We may use cookies or any other tracking technologies when you visit our website, including any other media form, mobile website, or mobile application related or connected to help customize the Site and improve your experience. learn more

Allow