Before starting, ensure the kernel recognizes the new size of the disk:
sudo partprobe
Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra 209715200 blocks) or continue with the current setting? If you get a warning about unused space in the GPT, you can fix it using the steps in the next section.
Now, let's list the current partition:
lsblkUse parted to resize the partition
-
Open
parted:sudo parted /dev/sda
-
Inside
parted, print the current partition layout:print
-
Resize the last partition (
sda3) to use all available space:resizepart 3 100%
-
Exit
parted:quit
Once the partition is resized, expand the Physical Volume (PV):
sudo pvresize /dev/sda3Extend the Logical Volume (LV) to use the newly available space:
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lvResize the filesystem to utilize the expanded logical volume.
sudo resize2fs /dev/ubuntu-vg/ubuntu-lvsudo xfs_growfs /dev/ubuntu-vg/ubuntu-lvCheck the new disk size using:
df -hThis should show the updated disk space on your root partition.