Recently, I deployed a new server to a customer with a fresh install of Ubuntu Server 20.04.1 using the default partitioning which defaults to using all free disk space for LVM. However, shortly after taking delivery of the server, my customer reported that the disk was only 200 GB. What? I physically inventoried this server myself! It’s brand new from my hardware vendor. I logged every component in my asset tracking system.
Unless I read the order wrong or I misread the label, the server has a Micron M.2 1 TB drive in it.
My customer returned df -h showing 200 GB.
Looking into it further and testing with a virtual machine created from the same media, I discovered that Ubuntu Server 20.04.1 may not actually give all the disk space to the LV. My test server was given 50 GB disk but only had 24 GB available.
Here’s how to fix:
Resize the logical volume to use all available space:
$ sudo lvm lvm> lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv lvm> exit
Now, resize the file system.
$ sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
And then if you run df -h again, you’ll see that it’s using all available space.
If you changed your LVM settings from the default, you’ll just need to adjust those when running the commands listed.