Linux Labs

Storage / Stage 1 of 11

Out of space — which resource?

Not running Starting usually ~20 s
Leave the lesson

Step 4 of 8 · on a machine · 6 min

Who consumes the resource

Once you know which resource ran out, find where it was spent and free only what you are allowed to.

du walks directories and adds up what they contain. With a depth limit it breaks the usage down by subdirectory:

bash
du -x -h --max-depth=1 /PATH         # blocks per subdirectory
du -x --inodes --max-depth=1 /PATH   # inodes per subdirectory

-x keeps the walk within one filesystem: without it the report includes everything mounted inside the path. Replace /PATH with the directory you are investigating. With the --inodes option, du counts files and directories, which is to say the inodes spent.

The two reports often point at different directories; search by the resource that ran out. Do not hide Permission denied messages during the walk: a skipped directory drops out of the report.

Warning

A directory name like cache or tmp gives no permission to delete: that comes from the task statement or the service owner. Remove a specific subdirectory, and afterwards test a write as the user whose write failed: root bypasses permissions and can hide another cause.

In the exercise the volume is rebuilt: tmp holds two disposable directories, and the task does not say which one blocks writes.

Exercise · do it

Find what took the inodes

Files cannot be created in /mnt/lab-data again. From tmp, remove only the subdirectory (uploads or thumbs) that causes this, since the service still needs the other one; leave data alone. Then, as your own user, create report.txt in the volume root with the line report-ok.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • Free the inodes by removing the right directory from tmp not done yet
  • Write report.txt as your own user not done yet

Step goals

0 of 2
  • Free the inodes by removing the right directory from tmp — not done yet
  • Write report.txt as your own user — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • Free the inodes by removing the right directory from tmp — not done yet
  • Write report.txt as your own user — not done yet
Loading…