Linux Labs

Storage / Stage 6 of 11

Logical volumes and growing a filesystem

Not running Starting usually ~20 s
Leave the lesson

Step 1 of 7 · on a machine · 4 min

The volume is full, yet there is room

What you will learn

  • Use lsblk, vgs and lvs to find which layer holds the free space.
  • Give a volume its final size and count the extents it needs.
  • Grow a volume and its ext4 and check both layers with lvs and df.

A service writes its data to /mnt/lvm-data, and the writes have stopped going through. The device under that directory was sized with room to spare.

Try writing a line, check how much space the volume has, and print the device tree with lsblk.

Exercise · look

Write a line and look at the devices

Try writing a line to /mnt/lvm-data/report.txt, look at df -h for /mnt/lvm-data and at the lsblk device tree. Delete nothing.

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

loop0 is 384M, the data volume on it is 128M, and the volume is full. Where is the rest of the device's space?

  • ext4 keeps its metadata inside the volume, which is why df -h shows a Size of 104M for a 128M volume. Outside the volume ext4 stores nothing.

  • lsblk shows 32M for keep: together with data that is 160M of 384M.

  • lsblk rounds to the megabyte, not by a factor of three: 384M means 384 MiB, three times the volume.

More than 200M of the device belongs to no volume, so the filesystem on data cannot use it.

Ubuntu 24.04
Loading…