Menu

1 / 4

Disk Full on a Linux VPS? How to Find What Is Using the Space

DEV Community: docker·Pro Gineous·about 20 hours ago
#Q2CIMtaT
#devtodocker#devto#dev#fullscreen#file
Reading 0:00
15s threshold

A full disk rarely announces itself. MySQL stops accepting writes, WordPress can't upload an image, apt fails halfway through an upgrade, or you get "No space left on device" from a command that worked yesterday. On a 20 or 30 GB VPS, one chatty log or a forgotten backup folder is enough.

The fix is almost never "delete random big things until it works". It's a short triage: confirm what kind of full you are, find where the space went, clear the parts that are safe to clear, and leave the rest alone. Below is the order we work through, with the commands and real output from a test server in the same state.

Step 0: buy a little room first

At 100%, some tools won't even start because they can't write a temp file. Two commands are safe on almost any Debian or Ubuntu server and usually free a few hundred megabytes:

sudo apt-get clean sudo journalctl --vacuum-size = 200M

Enter fullscreen mode

Exit fullscreen mode

The first removes downloaded .deb files, which apt can fetch again.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.