Linux Labs

Storage / Stage 1 of 11

Out of space — which resource?

Not running Starting usually ~20 s
Leave the lesson

Step 1 of 8 · on a machine · 5 min

The report was not written

What you will learn

  • Check both resources of the filesystem that serves a path — blocks and inodes.
  • Explain how a file's size, its allocated blocks and its inode differ.
  • Find what consumes an exhausted resource and free only data you are allowed to remove.

In the morning the reporting service logs No space left on device. It keeps its reports in the /mnt/lab-data directory.

Before deleting anything, check how much space is there and try to create a file yourself. df -h shows how much of the volume is used and how much is free, and touch creates an empty file.

Exercise · look

Space left, no file

Check how much space is free in /mnt/lab-data and try to create an empty file report.txt there. Delete nothing.

Sign in and start The machine is available after signing in
Check yourself 1 question

df -h shows an almost empty volume, yet touch cannot create even an empty file on it. Which explanation accounts for both outputs?

  • df already subtracts root's reserve: Avail is the space available to you, and it is almost the whole volume. If the reserve were the cause, Avail would show zero.

  • df takes its numbers from the filesystem at the moment you run it; it has no delay. Run df -h again: the figures are the same, and touch fails again.

  • In someone else's directory touch would print Permission denied. "No space left on device" is an exact message from the filesystem: a volume resource has run out.

The volume has run out of inodes, the records the filesystem keeps for every file, even an empty one.

Ubuntu 24.04
Loading…