Tuesday, January 31, 2012

Expand Disk in Virtaul Machine

One of the greatest advantage to use virtual machine is the flexibility of hardware. Under physical hardware constrain, expanding hardware in a virtual machine is quite simple. For CPU and memory, the setting is automatically complete by Windows. So all we need to do is turn off virtual machine, setting, and turn on it.

To expand volume size, we need to expand disk in virtual machine settings.

And use embedded program "diskpart" to extend it.

C:\Documents and Settings\Administrator>diskpart

Microsoft DiskPart version 5.2.3790.3959
Copyright (C) 1999-2001 Microsoft Corporation.
On computer: WIN2K3X86

DISKPART> list volume

Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 0 C NTFS Partition 15 GB Healthy System
Volume 1 D CD-ROM 0 B Healthy
Volume 2 E New Volume NTFS Partition 20 GB Healthy

DISKPART> select volume 2

Volume 2 is the selected volume.

DISKPART> extend

DiskPart successfully extended the volume.

DISKPART> list volume

Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 0 C NTFS Partition 15 GB Healthy System
Volume 1 D CD-ROM 0 B Healthy
* Volume 2 E New Volume NTFS Partition 21 GB Healthy

DISKPART>


Besides, due to the system disk protection, the function is blocked on system disk in windows 2003. After expand disk in virtual machine settings, we need to mount the disk file in another machine, extend this disk as a normal volume, and turn on the original virtual machine. The system disk is expanded to desired size.

--
Reference
How to Extend Windows Boot Volumes in VMware