Expanding A VMWare Client Disk
I’ve become a big fan of vmware, but if you undersize a virtual disk and need to expand it on Linux, brace yourself for about an hours worth of work (at minimum.)
Here’s the process I eventually followed (this seems way too hard/complicated)
- BACKUP up your virtual machine!!!
- expand the virtual disk:
vmware-vdiskmanager -x 16GB myDisk.vmdk
for instance this will size myDisk to 16GB (this size isn’t additive it’s an absolute size)
-
Now you must boot your virtual machine into DOS or some OS that will recognize your disk, I went the BartPE route and added the vmware scsi driver so it would recognize the
scsi disk. I couldn’t find the actual scsi driver on the web fotunately I had a copy of the VMWare Converter which
contains a copy of the drivers. You can follow the instructions at this site but the driver that is offered is incomplete. -
Once you’ve booted BartPE start diskpart and issue the following commands:
- diskpart> list disk
- diskpart> list volume
- diskpart> select volumen=n
- diskpart> extend
- diskpart> exit
- Reboot the virtual machine, restarting Fedora (or your brand of Linux)
-
Start the Linux Volume Manager (lvm)
- Find the physical volume with lvm> pvscan
- Resize the physical volume lvm> pvresize /dev/sda?
- Resize the logical volume lvm> lvresize -L 14G /dev/VolGroup01/LogVol00
- lvm> exit
- Finally resize your filesystem with (on Fedora, other brands of linux may have a different command):
root# resize2fs /dev/mapper/VolGroup00-LogVol00
-
Sheesh, that was a lot of work, the procedure for windows seems slightly easier, but I couldn’t find all this information
easily in one place for Fedora/Linux, good luck.
Thanks for this post! We use VMware a lot at work. Try VirtualBox – it’s free. I only just downloaded it so cannot comment on it yet.
hey great advice, worked a treat much apreciated !
The only difference was i used the command
vmware-vdiskmanager-x [Expansion Amount]GB [drive name].vmdk
to make the drive larger, but as i had a default fedora config with the mount / being the whole drive your advice worked to resize the entire volume which from the config-system-lvm interface i couldn’t get to work as it wanted to unmount the root volume
so thanks again, that’s saved me a heap of work!
Bob
sorry my bad .. i mean I used gparted [yum install gparted] instead of diskpart
I ran this inside the actual fedora vm rather than a seperate machine, i had issues with it seeing the drive as corupted when i opened it in another vm.. it opened fine in its own machine. it is an expanding disk though.. anyway thanks for the great help 🙂