Step 1 – Preparations
Check the current partition table (it should look similar to this, depending on the model):
#fdisk -l /dev/sda
Step 2 – Checking the File System (optional)
Check the file system with:
# e2fsck -f -C0 /dev/sda2
Step 3 – Resizing the File System
Resize the file system with:
# echo 1 > /sys/block/sda/device/rescan && growpart /dev/sda 2 && partx -u /dev/sda && lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv && resize2fs /dev/ubuntu-vg/ubuntu-lv && resize2fs /dev/sda2
In case of LVM
# echo 1 >
/sys/block/sda/device/rescan && growpart /dev/sda 2 && partx -u /dev/sda && pvresize /dev/sda2 && lvextend -r /dev/ubuntu-vg/ubuntu-lv /dev/sda2
Check if the disk is larger.
df -h