Alright. Things, that I always tend to forget is how to resize online the volume after the VMware guys did resize the disk of a VM.
1. Rescan
Before re-scan of the block device check the size. You can see here, that sda has the size of 450GB. It should be 500GB.
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 450G 0 disk
??sda1 8:1 0 1M 0 part
??sda2 8:2 0 2G 0 part /boot
??sda3 8:3 0 448G 0 part
??system-swap 253:0 0 4G 0 lvm [SWAP]
??system-root 253:1 0 15G 0 lvm /
??system-var--log 253:2 0 5G 0 lvm /var/log
??system-docker 253:3 0 415.1G 0 lvm /var/lib/docker
sr0 11:0 1 1024M 0 rom
Do the fancy rescan:
echo 1 > /sys/block/sda/device/rescan
Check again. You see, that the disk has now the size of 500GB.
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 500G 0 disk
??sda1 8:1 0 1M 0 part
??sda2 8:2 0 2G 0 part /boot
??sda3 8:3 0 448G 0 part
??system-swap 253:0 0 4G 0 lvm [SWAP]
??system-root 253:1 0 15G 0 lvm /
??system-var--log 253:2 0 5G 0 lvm /var/log
??system-docker 253:3 0 415.1G 0 lvm /var/lib/docker
sr0 11:0 1 1024M 0 rom
2. Resize
I am simpleminded. If there are more, than 3 partitions, you have to destroy the partition table, and resize it. Can’t do it. I always fail. Luckily there are only 3 of them, so I use growpart to resize the 3rd partition. It can be found in the cloud-guest-utils package.
# growpart /dev/sda 3
Now check again. Now you see, that /dev/sda3 is resized.
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 500G 0 disk
??sda1 8:1 0 1M 0 part
??sda2 8:2 0 2G 0 part /boot
??sda3 8:3 0 498G 0 part
??system-swap 253:0 0 4G 0 lvm [SWAP]
??system-root 253:1 0 15G 0 lvm /
??system-var--log 253:2 0 5G 0 lvm /var/log
??system-docker 253:3 0 415.1G 0 lvm /var/lib/docker
sr0 11:0 1 1024M 0 rom
3. Logical volume stuff
Alright, that you have it, check the physical volume:
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 system lvm2 a-- <448.00g <58.94g
Resize the volume according to your needs:
# lvresize -rL+50G /dev/mapper/system-docker