Disk Is at 100% and the App Is Down. rm -rf?

A server is out of disk and the app is down. A teammate wants to rm -rf the logs to free space fast. Defend what you actually do first.

beginner8 min4 roundsEasy mode availableLinux

Answer key reviewed by Branko Petric

Read first: Linux for DevOps: The Fundamentals

Your decision

A web server is throwing 'No space left on device' and the app is down. df shows / at 100%. A teammate says just run rm -rf on /var/log to free space fast. What do you do, and why?

The situation

It is the middle of a workday. The main web server starts returning 500s and the application log shows repeated 'No space left on device' errors. You SSH in and df -h shows / at 100%.

Context

It is a single VM running the app behind nginx. Application and access logs are written to /var/log, and no log rotation was ever configured. A teammate in chat says: just rm -rf /var/log and restart the service, that always works.

More: Linux troubleshooting interview questions