Ubuntu Server 20.04.1 LTS, not all disk space was allocated during installation?

I also used the default Ubuntu 20.04 install from ISO w/ lvm option selected. I had the same problem with the OS disk not occupying what I had allocated. Eddie's suggestion and the provided link did it for me. To summarize:

root@util:~# vgdisplay
<snip>
root@util:~# lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
<snip>
root@util:~# resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
<snip>

Before

root@util:~# df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               3.9G     0  3.9G   0% /dev
tmpfs                              795M  1.1M  793M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   98G  6.5G   86G   8% /
tmpfs                              3.9G     0  3.9G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/xvda2                         976M  105M  805M  12% /boot
/dev/loop2                          56M   56M     0 100% /snap/core18/1944
/dev/loop0                          32M   32M     0 100% /snap/snapd/10707
/dev/loop1                         132M  132M     0 100% /snap/docker/796
/dev/loop3                          70M   70M     0 100% /snap/lxd/19188
/dev/loop4                          33M   33M     0 100% /snap/snapd/11588
/dev/loop5                          56M   56M     0 100% /snap/core18/1997
/dev/loop6                          71M   71M     0 100% /snap/lxd/19647
tmpfs                              795M     0  795M   0% /run/user/1000

After

root@util:~# df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               3.9G     0  3.9G   0% /dev
tmpfs                              795M  1.1M  793M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  196G  6.5G  180G   4% /
tmpfs                              3.9G     0  3.9G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/xvda2                         976M  105M  805M  12% /boot
/dev/loop2                          56M   56M     0 100% /snap/core18/1944
/dev/loop0                          32M   32M     0 100% /snap/snapd/10707
/dev/loop1                         132M  132M     0 100% /snap/docker/796
/dev/loop3                          70M   70M     0 100% /snap/lxd/19188
/dev/loop4                          33M   33M     0 100% /snap/snapd/11588
/dev/loop5                          56M   56M     0 100% /snap/core18/1997
/dev/loop6                          71M   71M     0 100% /snap/lxd/19647
tmpfs                              795M     0  795M   0% /run/user/1000

I had this problem also. The link below has instructions on how to extend the LVM partition to use all available space.

https://www.linuxtechi.com/extend-lvm-partitions/

Not mentioned in the above link is this command to use all remaining space rather than specifying a specific amount to add:

lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv

The installation is misleading because I specifically selected the option to use all available space, but not all available space was utilized.


Your root filesystem is on an LVM logical volume (LV) /dev/mapper/ubuntu--vg-ubuntu--lv (196 GB).

The LVM volume group (VG) that provides disk space for that LV probably has one single physical volume (PV), presumably that third partition on that SSD (/dev/nvme0n1p3 with 952.4G).

The VG probably still has a lot of disk space that you could use to make that LV bigger or to create another LV. It might be a disk space allocation strategy of the Ubuntu installer not to simply use all available disk space straight away for the root filesystem, giving you some leeway to decide what to do with the remaining disk space.

You didn't use the "-T" argument to the "df" command, so it doesn't tell the filesystem type; but most modern Linux filesystems have a tool to resize them. ext4 certainly supports that.

Here is a tutorial on the LVM tools: https://www.digitalocean.com/community/tutorials/how-to-use-lvm-to-manage-storage-devices-on-ubuntu-18-04

If you didn't explicitly select using LVM during installation, this might also be a result of choosing encryption; that is typically done via LVM.

HTH


Just run this command from the terminal:

sudo resize2fs -p /dev/mapper/ubuntu--vg-ubuntu--lv`

That did it for me. Then check it with:

df -h