Skip to main content

Find what is using disk space on a Linux VPS

Measure the affected filesystem

CloudExaA helpfull guide.Linux filesystem can stop databases, package updates and application saves. First identify which filesystem is full. These checks inspect the VPS operating system; they do not change your hosting plan or resize a partition. Keep a working SSH session and a browser console available before changing system files.

df -hT
df -i
findmnt -T /var

Look at the mount point and filesystem type, not only the largest percentage. A full root filesystem differs from a full data volume. Inode exhaustion can prevent new files even when byte capacity remains. Record the output and time so you can compare after a deliberate repair.

Locate large directories without crossing mounts

Begin with a bounded inspection of the affected mount. On Debian or Ubuntu with GNU tools, this example shows allocated space under the root filesystem:

sudo du -xhd1 /

The -x option keeps this scan on one filesystem. Repeat against the largest relevant directory, such as /var, instead of repeatedly scanning every mounted backup and network share. Permission errors mean your result may be incomplete. A large scan can produce disk activity, so run it once and allow it to finish.

Check whether an application, local archive or database is responsible. A backup stored on the same filesystem still consumes that filesystem. Docker layers, snapshots and separate mounts need their own storage-aware tools; removing their underlying files manually can corrupt the service that owns them.

Explain a difference between df and du

df reports filesystem accounting, while du totals reachable files. Their values need not match. Filesystem metadata, reserved space, snapshots, mount boundaries and open deleted files can contribute. Use the comparison to narrow the investigation rather than assuming missing files.

sudo lsof +L1

If installed, lsof can identify open files whose link count is below one. Read the process name, PID and file details together. A deleted log may continue occupying space until its process closes the descriptor. Do not kill every listed process or write into its /proc descriptors. Plan a supported log reopen or a graceful restart of the specific application after checking its dependencies.

Recover space with a specific plan

Before removing anything, identify the owner, purpose and recovery value of the file. Copy a needed archive to independent storage and verify that copy. Use the application's retention controls for logs, backups or database data. Do not delete database tablespaces, active logs or your only recovery copy to gain temporary headroom.

Repeat df -hT and the targeted directory check afterward. Confirm the application can write and restart normally. If usage returns quickly, investigate the producer and retention policy. Send support the mount point, recorded measurements and relevant filenames; redact private paths or credentials in logs. A larger virtual disk alone will not automatically prove that its partition and filesystem have grown.

For service access, see VPS access and console recovery. When contacting us, follow the support-ticket checklist.

Further reading