I recently installed Ubuntu 20.04 server*, and after a while got into trouble because of "no space left on device". It was only then when I realized that the Ubuntu install had not used the available disk space in full:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
[...]
nvme0n1 259:0 0 931.5G 0 disk
├─nvme0n1p1 259:1 0 1.1G 0 part /boot/efi
├─nvme0n1p2 259:2 0 1.5G 0 part /boot
└─nvme0n1p3 259:3 0 929G 0 part
└─ubuntu--vg-ubuntu--lv 253:0 0 100G 0 lvm /
As I understand the output, the partition nvme0n1p3
has a size of 929 GB, but Ubuntu uses only 100 GB of that. I don't know why that happened, as I have an older Ubuntu 20.04 Server installation that looks as I would expect it:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
[...]
nvme0n1 259:0 0 953.9G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
├─nvme0n1p2 259:2 0 1G 0 part /boot
└─nvme0n1p3 259:3 0 952.4G 0 part
└─ubuntu--vg-ubuntu--lv 253:0 0 952.4G 0 lvm /
I found this answer and this answer and tried it, but the response was:
$ sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv 929G
resize2fs 1.45.5 (07-Jan-2020)
The containing partition (or device) is only 26214400 (4k) blocks.
You requested a new size of 243531776 blocks.
So it tells me that the containing partition is only 100 GB in size, while lsblk
obviously tells me something different.
How can I make Ubuntu use all of the available 929 GB?
*The same still happens with Ubuntu 22.04.1 LTS server, although I'm sure I told the installer to use all available disk space.