Resizing paritions is not something I find myself doing very frequently so I tend to forget the procedure. Below is what I did to resize a parition in Ubuntu16.04. This server is a vm running inside esxi.
I’ve already resized the disk in the vmware console from 30 to 100GB. We are now ready to work on the server.
Reisizing the Parition
Here we can see that our Logical Volume is only 24Gb
We set the output to show in bytes and print the sizes of our partitions:
Since our parition is on an extended partition, we need to resize both, the extended (2) and the logical (5) paritions.
We resize these paritions to use the rest of the free space on the disk. This is the value taken from the end column of the last line in the above output.
Next, we need to resize the adjust the size of the physical volume to account for the changes we made in the previous step.
Now that we have the physical disk resized, we can resize the LVM. You can use lvscan to show the names of the LVM if you are unsure of the names.
Here we extend the volume to use 100 percent of the free space on the physical volume.
Lastly, we need to tell the partition about the new space so we can use it.
|
|
Verify the new space