Expanding Partition on VMWare
Found this question posted on stackoverflow, but I think using GParted is the easiest and flexible.
I have Windows 7 as the host, and CentOS 6.5 as the guest, but I think this method will work on most linux guests where GParted works.
- Download GParted iso file from SourceForge.
- Expand the size of guest storage on VMware Settings menu. In my case, I expand the storage size from 50GB to 200GB.
- Point the CD/DVD(IDE) to the GParted file.
Since we want to boot from CD/DVD drive, we have to change so on the boot screen by pressing F2 before it changes to grub menu. However since VMware’s boot screen only flashes less than 1 second, we will change that. Go to your
.vmx
; in my case, I have it inC:\Users\yuriardila\Documents\Virtual Machines\centos64-64bit\centos64-64bit.vmx
Add this specific line to the file. Location does not matter.
bios.bootdelay = 20000
This wil increase boot screen delay to 20 seconds. Let’s hope that that is enough.
- Start VM, and enter setup menu by pressing F2.
- Change boot priority.
- Boot GParted. Follow default options.
- After it’s booted, it should show window like this. Now I want that unallocated partition to be combined with my main CentOS partition, which is
/dev/sda2
. - This can be easily done. But first, I need to move the red part (
linux swap
), so that I can combine them. Right click on thelinux swap
, and chooseResize/Move
, and then move the red box to a location you prefer. In my case, I have enough free space following, in case this swap area need more storage. - Now we can enlarge our main linux partition as we will.
- Click
Apply
and wait until everything is done. - Don’t forget to change your VMware’s boot delay setting back, or else you will have to wait for 20 seconds on each boot.