extend sda partition under LVM

Solution 1:

Yes, you can use gparted to extend partition n.4 and then (assuming you want to extend your logical volume using all free space) issue the following commands:

  1. pvresize
  2. lvresize /dev/mapper/vg_linuxwebserver2-lv_root -l+100%FREE

Anyway, I suggest you to print a sector-addressed partition table (you can switch to sector-based size using fdisk -u, so that if gparted fails to resize your partition, you can easily reconstruct it via fdisk

You can also do a binary backup of your partition table using the command

dd if=/dev/sda of=ptable.bin bs=512 count=1