VMware Cloud Community
dwchan
Enthusiast
Enthusiast

disk alignment for VM guest

We are in the process of redoing our VM guest template. We want to include disk alignment to all of the drive reside within our VM guest. The way we have its set up each drive letter is it own physical drive/vmdk. But since you really can't perform disk alignment on drive C until the os is build, we figure we create a 2nd drive (new C) and do a bit copy fro mone drive to another. However, i do have few question i like to ask

1. does anyone know the proper syntax with either diskpart or diskpar for proper disk aligment?

2. the though was to create a VM guest with 2 drive. During the initate install, only the 1st drive get format by Windows 2003 installer. Once the OS is build and by, i was going to run diskpar from the command line to fit the disk alignment and format it from the command line on the 2nd drive (versus taking the OS default, which will put it out of alignment) But afterward, what is the best way to copy the data over from drive c to the new drive c without disrupted the new alignment and preserve the boot loader

dwc

0 Kudos
9 Replies
Gabrie1
Commander
Commander

Can't you format the disk before the OS is installed? In a running VM, mount your "soon-to-be-Cdrive", format and allign it. Then remove the disk from the VM, build a new VM with this disk and install on the already created partition.

Question from me: Is the performance gain from this allignment in the VM realy worth the hassle?

http://www.GabesVirtualWorld.com
0 Kudos
dwchan
Enthusiast
Enthusiast

That is true, but doesn't winnt32.exe format your drive during the installation anyway? If it does, would it erase what I have just done regarding to the alignment?

dwc

0 Kudos
Gabrie1
Commander
Commander

If I'm not mistaken, the allignment is done by creating a partition starting at block 64. So as longs as you don't throw away the partition you should be fine.

http://www.GabesVirtualWorld.com
0 Kudos
jmacdaddy
Enthusiast
Enthusiast

You can align your C:\ partition before you install your OS if you have a proper PE boot .iso. I personally use BartPE.

Here are the steps I used:

1. Slipstream a Windows 2003 install cd with SP2

2. Use it to create a BartPE boot .iso from the instructions found here: ; before you create the .iso, make sure that you use the hotfix plugin described here:

3. Copy the .iso up the location on your SAN where you store such things.

4. Create a new Windows virtual machine with its virtual disk and boot the first time from your BartPE.iso.

5. You will be able to run diskpart and see your unpartitioned virtual disk. I always partition with the following command: create partition primary align=64

6. Shutdown VM, detach the BartPE cd, and attach your Windows install media. Boot up, and you will see an existing (aligned) partition that you can install Windows to.

Yeah, there is some up front work, but that BartPE iso will come in handy for lots of tasks.

If this answer works for you, don't forget to assign points.

0 Kudos
dwchan
Enthusiast
Enthusiast

so as long as the partition i setup doesn't get reset (i.e. delete the partition and re-add the partition), i am ok? by default, our scripted build format the parition to fat32 and than the installer convert it to NTFS? would this be a problem? Also, do you format the drive within Bart? or you let the nt installer do that?

dwc

0 Kudos
jmacdaddy
Enthusiast
Enthusiast

so as long as the partition i setup doesn't get reset (i.e. delete the partition and re-add the partition), i am ok? - right

by default, our scripted build format the parition to fat32 and than the installer convert it to NTFS? would this be a problem? - Since you are just reformatting the partition, not deleting and recreating it, it shouldn't impact the alignment

Also, do you format the drive within Bart? or you let the nt installer do that? - I let the installer do it. Just my preference.

0 Kudos
dwchan
Enthusiast
Enthusiast

a bit confusing. Accord to vmware article, it say use align=32. but most people here say use 64 block alignment? so which align= setting should i use?

0 Kudos
BUGCHK
Commander
Commander

The diskpart align= value is specified in KBytes, so 32 KBytes = 64 (512-Byte) Blocks.

0 Kudos
dwchan
Enthusiast
Enthusiast

i see, so the alignment value in diskpart uses KB, but we want to offset its by 64 (512Bytes) blocks. This VMware article is correct, I need to set align=32

dwc

0 Kudos