Skip to content
ohsudo, Home

Module 5: Real incidents

Incident: the disk is filling up

An alert says the disk is filling up. You've got all the commands for this now, so the steps only tell you what to find out.

● Runs 100% in your browser. Nothing here can harm a real system.

Step 1 of 6

Confirm it

Before anything else, see how bad it is, and on which filesystem.

Your task

See how full the disks are.

guest@ohsudo: ~ — Ubuntu 24.04

Starting the terminal…

What you'll practice

  1. Confirm it. Before anything else, see how bad it is, and on which filesystem.
  2. Which top folder?. -x stays on one filesystem, so it won't wander into others. Errors about folders you can't read are just noise, so use sudo, and throw away what's left.
  3. Go deeper. Follow the biggest one down, a level at a time, until you reach the cause.
  4. Name the files. find goes straight to the big files, wherever they are.
  5. Free the space safely. Here's the trap: deleting a log that a program has open doesn't free the space until that program closes it. truncate -s 0 empties a file in place, which is safe either way. debug.log.1 is an old, rotated log, so it isn't needed.
  6. Check the result. Check that the space came back. Then the real fix is making sure it doesn't happen again, with log rotation, and asking why something logs so much at debug level.

See also