Expand Partition Size LVM or Not :D
If it is a physical disk (not LVM, you can check it with lvdisplay), then you need two steps:
- Grow your partition (e. g.
/dev/sdb1):sudo growpart /dev/sdb 1Yes, separate the partition number from the device 😉 - Grow your filesystem:
sudo resize2fs /dev/sdb1
If it is a LVM, you need three steps:
- Grow your physical volume:
sudo pvresize /dev/sdb1And wait untilsudo pvdisplayreturns your new size. Whilepvresizealready reports that the resize happened and thus terminates, the resize may actually still be ongoing on very large disks. If this does not resize your physical volume while telling you it actually does, you can trygrowparton/dev/sdb1first (see above at physical disk). - Grow your logical volume[1]:
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv - Grow your file system[1]:
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
[1] Where /dev/ubuntu-vg/ubuntu-lv is the path to your logical volume. You can query it with sudo lvdisplay. Alternatively, you can use the mapped name of your logical volume, e. g. /dev/mapper/ubuntu--vg-ubuntu--lv, that you see in the output of df -h.
Thnx for stackprotector