I have the following info using df
:
francis@playground /var/log sudo df -h
Filesystem Size Used Avail Use% Mounted on
udev 2.9G 0 2.9G 0% /dev
tmpfs 595M 46M 549M 8% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 39G 39G 0 100% /
tmpfs 3.0G 0 3.0G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
My volume group is using /dev/sda3
.
The thing is, I enlarged the disk of this VM to 81G (it was 40GH). Then, I used fdisk to delete /dev/sda3
and create a new partition with the new space. It worked:
Device Start End Sectors Size Type
/dev/sda1 2048 4095 2048 1M BIOS boot
/dev/sda2 4096 2101247 2097152 1G Linux filesystem
/dev/sda3 2101248 171966430 169865183 81G Linux filesystem
Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 38.97 GiB, 41821405184 bytes, 81682432 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
However, I the volume group doesn't see the new space:
--- Volume group ---
VG Name ubuntu-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size <38.95 GiB
PE Size 4.00 MiB
Total PE 9971
Alloc PE / Size 9971 / <38.95 GiB
Free PE / Size 0 / 0
How can I get it to see the new, enlarged /dev/sda3
?
lvextend
now has an option-r, --resizefs
to take care of the latter automatically – steeldriver Feb 28 '23 at 20:48