To increase the disk size inside the VMware guest running CentOS7 (7.3, 1611) these are the steps needed:
a. Remove all snapshots from your Vmware image, or if you cannot afford to remove the snapshot, shutdown the guest OS, and "clone from snapshot" (you can select any specific snapshot to clone) to create a new Vmware image. This new one is totally independent, and will not have any of the snapshot.
b. Now go to VMware settings, hardware, and "hard disk" to select "Expand Disk" option.
c. After expanding disk, reboot into your CentOS.
d. Issue "sudo fdisk /dev/sda" to repartition the /dev/sda inside the guest OS:
And here is the partition deletion and recreation part (be careful) – the starting block number must be the same, but the end will default to the largest possible block number.
Now remember to REBOOT, as the partition table will not be updated until after reboot.
And now check using pvdisplay – it is not updated yet, still 75G. Use "pvresize" to extend it.
So now the PV occupies 200G.
Now check with lvdisplay:
So we need to extend the LV to 200G:
Followed by xfs_growfs:
Check now:
Updated.
Posted by How to extend the disk size in my VMware guest running Centos 7 | My Technical Blog – Log@X.X.B on September 3, 2018 at 1:36 pm
[…] https://tthtlc.wordpress.com/2017/08/08/how-to-extend-the-disk-size-in-my-vmware-guest-running-cento… […]
Posted by Andy Ritting on November 27, 2018 at 9:09 am
thanks, this is exactly what I needed.
Posted by Lycée Français de Kuala Lumpur on December 13, 2018 at 4:10 pm
Perfect, a big thanks ! Worked liked a charm.
Posted by Bones Cisco on December 31, 2018 at 1:48 am
Awesome worked perfectly
I wanted to show appreciation
Posted by Dennis Dupont on January 24, 2019 at 1:13 pm
Thanks Peter – this was step for step perfect
Posted by ILYA Zadorojnyi on February 19, 2019 at 5:32 am
Nice mate , straight to the point ! Thank you!
Posted by Hector Daniel Rojas Garzon on April 13, 2019 at 12:55 pm
perfect… work very good 😀 thank you boss !!
Posted by moredakka79 on September 5, 2019 at 1:50 pm
Worked perfectly! Thanks!
Posted by icepig vivien on February 11, 2020 at 3:36 pm
save my life! thanks!
Posted by Nathan Marsili on September 1, 2020 at 9:53 am
This saved me also, thank you! Does anyone know if these instructions above would work for increasing home instead of root, by just replacing with centos-home?