Sunteți pe pagina 1din 11

Resize Windows Virtual Machine System/Boot Drive (Windows) Tom Halligan

Purpose:
This procedure is unsupported at this time, and perhaps unwise. The methodology is sound though as a means to reduce the size of an existing Windows VMs C: disk (Growing a System volume is a bit easier you just attach the drive to another VM, grow it the extended it using diskpart or diskpar) This procedure would be useful in P2V situations where space on target ESX LUN is limited. Also this procedure would be useful in instances where multiple VMs have been built out and it is found that the systems have been built with C: drives in excess of what is needed for the funtiong of the VM. Requirements: There must be enough space on a LUN presented to the ESX host for the Gparted ISO (Roughly 95MB) and the creation of 1 new VMDK file of the correct size for the C: drive of the 1st VM to be resized. Once the first VM has been resized subsequent VMs will be able to use the freed space to be adjusted in turn. Notes: This procedure has only been tested on ESX 3.5. This procedure may not work on earlier versions of ESX Familiarity with basic ESX administration is assumed in this document. If you are unfamiliar with editing VM settings and basic Linux commands you should not be performing this procedure.

Procedure:
1. Transfer live image ISO of Gparted (See Links section at end of document for download location) to storage shared by VMs to be adjusted

2. Configure VM to boot to ISO image

3. Add a new drive to VM of size to be used by new C: volume. Drive should be stored in same location as existing VM files. Needless to say drive should be smaller than existing C: volume drive.

4. Boot system to Gparted Image. Select Safe graphic settings. You will be prompted for information regarding keemap and language.. etc just hit enter and except the defaults.

5. Once logged on you will be presented with Gparted interface. It will default to the first disk on the system (Your current C: disk) Right click on the partition and select resize/move. You will be able to slide the bar from the right to the left shrinking the existing partition to a size less than that of the newly added drive. Hit the Apply button at the top right portion the screen once you have submitted the resize action. The White space represents unused space on the existing partition. Needless to say if there is insufficient free space on the partition to allow it to be shrunk to a size smaller than the new drive, there is no point in proceeding. Dont worry about being exact with the size of the partition, just make it less than the new drive, we will be expanding the partition latter to use all available space on the new drive.

6. Once the above operation has completed we need to create a disk label on the new drive. Switch focus to the new drive. Right click on drive and select New. You will be prompted with a dialog box to create a new Disklabel select Create.

7. Copy and paste the resized partition from the old drive to the new drive. Change focus to the old drive and right click on the partition and click Copy. Change focus to the new drive and right click on the disk and chose Paste. Hit Apply in the top right corner. This operation may take some time. Once completed resize partition on new drive to use all space on drive (Review procedure in step 5). Lastly set the boot flag by right clicking on the partition and choosing Manage Flags check boot

8. Shutdown Gparted. Edit the settings of the VM and remove the original disk and unmount the Gparted image from the VM CD drive. Startup the system, Windows will run chkdsk against the disk; this is normal and not indicative of an issue. Once the VM is up you will be prompted to reboot the system as new hardware has been detected; this is also normal and will only happen after the initial boot. Note: You may wish to modify the SCSI ID of the new drive to the value of the old drive (Now available) not doing this could cause issues in the future if other drives are added to the system as a new drive will take the firs available ID on the controller and you may have boot issues

Links:

http://gparted.sourceforge.net/index.php

S-ar putea să vă placă și