sgdisk -e /dev/sdb # Extend the GPT partition to use the entire disk
sgdisk -d 1 /dev/sdb # Delete the old partition
sgdisk -N 1 /dev/sdb # Create a new partition to fill the available space
partprobe /dev/sdb # Notify the system of partition changes
resize2fs /dev/sdb1 # Resize the filesystem to use the new partition size
- Use the GUI to increase the disk size of the virtual machine or physical machine.
-
Check free space on the disk:
sudo fdisk -l
-
Extend the physical partition:
growpart /dev/sda 3 # Replace /dev/sda3 with the correct partition
-
View physical volumes:
pvdisplay
-
Resize the physical volume to inform LVM that the disk size has changed:
sudo pvresize /dev/sda3
-
Verify the physical volume changes:
pvdisplay
-
View the current logical volumes:
lvdisplay
-
Extend the logical volume to use all available space:
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
-
Verify the logical volume has been extended:
lvdisplay
-
Resize the filesystem on the logical volume:
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
-
Verify the changes by listing the disk partitions:
sudo fdisk -l