Thanks a lot for @Bratchley answer and the comments. It helped me :)
My environment: Ubuntu 18.04 in VirtualBox 6.1
My case: I created 10GB fixed VDI disk and increased to 30GB dynamic using VirtualBox GUI. But still the increased space is not available to filesystem. Then came across @Bratchley answer.
Steps I ran:
- Run below command to get PV (Physical Volume) name (Ex:
/dev/sda1
)
sudo pvs
- Resize the PV (Ex:
sudo pvresize /dev/sda1
)
sudo pvresize <PV name from above step> # Ex: sudo pvresize /dev/sda1
- Run below command to get root logical volume name (Filesystem value of
/
row; ex:/dev/mapper/ubuntu--vg-root
)
df -h
- Expand logical volume (ex :
sudo lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
):
sudo lvextend -r -l +100%FREE <root logical volume name from above step> # Ex: sudo lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-root