Skip to content
Mementropy
RecipesHomelab recipesReference

Leaving unallocated LVM space on Ubuntu Server for later growth

Keep the root volume small and grow it online when needed.

By Ryan Hammang

Keeping disk space free for later VMs or volumes, since ext4 can grow online but can’t shrink online.

  • Ubuntu Server installed with LVM (the installer default)
  1. See what’s allocated:
Terminal window
lsblk
sudo vgs
df -h /
  1. Leave the free space in the volume group. Do nothing else for now.

  2. When root needs more space, grow it and the filesystem together, online:

Terminal window
sudo lvextend --resizefs -L +50G /dev/ubuntu-vg/ubuntu-lv
  • sudo vgs shows VFree left over.
  • After an extend, df -h / shows the new size without a reboot.
  • The installer’s 100 GiB root can look like a mistake. It’s a safe default if you plan to grow later.
  • Growing to 100% right away leaves nothing for new logical volumes, and ext4 can’t give it back while mounted.