resize your LVM partition
resizing your LVM partition
So this process takes a little manual work but is pretty straight forward. We’re going to be using a DigitalOcean Droplet that was created using a custom image created from FreePBX distro 7. The issue was that the SSD was provisioned with 25G of storage, but the OS was only seeing 10G.
Start off by extending the /dev/vda2 partition
parted /dev/vda
This will enter parted’s interactive mode. you’ll want to enter in the command resizepart
, then enter the number of the partition you want to modify. In this case partition 2
. For the partition ‘end’ prompt you can enter in 100%
or -1s
.
This next step is a little odd but you can enter an estimate for the total size that should be allocated for /dev/vda2.
pvresize --setphysicalvolumesize 24.6G /dev/vda2
You’ll be see a prompt that actually states the real size. So you can just select no for the prompt to carry out the change and adjust the size on the command line. The output should look something like this:
/dev/vda2: Requested size <24.60 GiB exceeds real size <23.05 GiB. Proceed?
So the final command can look something like:
pvresize --setphysicalvolumesize 23.04G /dev/vda2
Now you can check the output of vgdisplay
and it should contain a line that looks like the following:
Free PE / Size 3929 / <15.35 GiB
Now you can finish up by resizing the logical volume. You’ll want to set the size to the output -.01 since it shows <15.35 GiB
:
lvresize -L +15.34G --resizefs /dev/mapper/SangomaVG-root
Now if you run df -h /
you should see that you can increased the amount of storage space for your Droplet.