Hi I am using a cloud provider (not AWS) to extend the file system on an Ubuntu VM.
The provider has extended it, and notified that the extension is on the same volume, but I cannot seem to figure out how to extend it. I can see the additional space with lsblk
:
$ sudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 200G 0 disk
├─vda1 252:1 0 487M 0 part /boot
├─vda2 252:2 0 1K 0 part
└─vda5 252:5 0 99.5G 0 part
├─vg0-swap 253:0 0 2.9G 0 lvm [SWAP]
└─vg0-root 253:1 0 96.7G 0 lvm /
while fdisk
shows:
$ sudo fdisk -l
Disk /dev/vda: 200 GiB, 214748364800 bytes, 419430400 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
Disklabel type: dos
Disk identifier: 0x2df69e85
Device Boot Start End Sectors Size Id Type
/dev/vda1 * 2048 999423 997376 487M 83 Linux
/dev/vda2 1001470 209713151 208711682 99.5G 5 Extended
/dev/vda5 1001472 209713151 208711680 99.5G 8e Linux LVM
Disk /dev/mapper/vg0-swap: 2.9 GiB, 3070230528 bytes, 5996544 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
Disk /dev/mapper/vg0-root: 96.7 GiB, 103788052480 bytes, 202711040 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
but I cannot figure out how to extend the root partition to take advantage of the extra 100GB that have been added.
In the past, using ec2, this was very simple:
I think there must be a very simple way to do this, but I cannot figure it out, and an hour or so of google has been no help.
EDIT: with the suggested link: https://serverfault.com/a/1049885/16985 the growpart seems to have worked and now lsblk
shows:
sudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 200G 0 disk
├─vda1 252:1 0 487M 0 part /boot
├─vda2 252:2 0 1K 0 part
└─vda5 252:5 0 199.5G 0 part
├─vg0-swap 253:0 0 2.9G 0 lvm [SWAP]
└─vg0-root 253:1 0 96.7G 0 lvm /
however resize2fs
and xfs_growfs
do not impact the Avail space or the lvm volume sizes. One step closer for sure though.
EDIT2: thanks to @michael_hampton I was able to complete the final steps with:
now everything looks hunky-dory:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 200G 0 disk
├─vda1 252:1 0 487M 0 part /boot
└─vda5 252:5 0 199.5G 0 part
├─vg0-swap 253:0 0 2.9G 0 lvm [SWAP]
└─vg0-root 253:1 0 196.7G 0 lvm /