VMware Cloud Community
praveen_masti
Contributor
Contributor

How to increase C drive size of VM

Hi All,

I know this might be a basic question of most of them,but i need an answer .

I have a virtual machine where the size of C drive where i have my OS is 10 GB . I need to install some applications ,how do i increase the size if the disk with out creating a new one?

I need the size of the disk tobe 25 gb. is there any command or process to do it ?

I am using ESX 3.0.1 and VC 2.0

Thanks for you help inadvance .

Praveen

0 Kudos
6 Replies
Dave_Mishchenko
Immortal
Immortal

There's 4 methods documents here: . Basically you'll need to shutdown the VM and then extend the VMDK with vmkfstools. Then you'll need to boot the VM with a utility CD to expand the C drive. The syntax for the vmkfstools command will be :

vmkfstools -X 25G <filename.vmdk>

0 Kudos
praveen_masti
Contributor
Contributor

Thank you Dave.

0 Kudos
EshuunDara
Contributor
Contributor

I recommend using a Knoppix CD or Knoppix ISO image to do the resizing -- just boot into linux, and use the QTParted tool to do the partition resizing. A Vista VM (and presumably a Windows 2008 Server VM, although I haven't tested it) can resize the C: drive while the OS is running...

0 Kudos
ejward
Expert
Expert

If this is a Windows VM, after you run VMKFSTOOLS, you can usually extend the C: drive from the command line using DISKPART without rebooting. Diskpart is a little "clunky" to use but, it's free and it works where other disk utilities have failed (Volumes over 500GB). Just go to the command prompt and type diskpart then hit enter. From there you have to type "help" to get a list of commands. Diskpart /? doesn't tell you anything. Usually it goes like this:

Diskpart

list disk (This displays all your disks .... usually just 1)

select disk 0

list volume (This displays the partitions. Make a note what number the C: partition is to use in the next line)

select volume 1

extend

The only catch is that the free space must show up right next to the volume you are extending.

Play around with diskpart on a VM you can throw away. A lot can go worng but, once you get the hang of it, it's easy.

What I have is a VM template that just 6GB. In a folder on the C: drive I have a script called extend.txt (The above lines are in that script). I've got a batch file that runs diskpart /s extend.txt. Most VM's are fine with 6GB. If somebody needs more, I run the Vmkfstools then, I go into the VM and run my batch file.

I've heard that Vmware has plans to intergrate the expansion of VMDK's into Virtual Center.

0 Kudos
dconvery
Champion
Champion

Sometimes you need to use a helper VM to mount the extended VMDK and run diskpart.

Dave Convery, VCDX-DCV #20 ** http://www.tech-tap.com ** http://twitter.com/dconvery ** "Careful. We don't want to learn from this." -Bill Watterson, "Calvin and Hobbes"
0 Kudos
ejward
Expert
Expert

That's a great idea!! I have had diskpart not work on VM's that already have a few drives or have odd partitioning schemes. I never thought of mounting the VMDK on a less complicated VM to extend the size.

0 Kudos