VMware Cloud Community
Khue
Enthusiast
Enthusiast
Jump to solution

Disk Alignment

I have been trying to align a boot partition for a while now and I have the feeling I am missing a step somewhere. I am creating a virtual machine with a 16 gig c: partition using the LSI Logic Parallel controller. After the VM has been created, I attach the 16 gig vmdk to a work horse machine. I start up the work horse machine and run the following command from dos on the 16 gig partition:

create partition primary align=64

Once I have run this command, I format the drive using NTFS with a 32k allocation unit size. When the format is done, I shutdown the work horse, disconnect the vmdk, and start the new VM up. As windows installs, I choose to setup the install on the existing NTFS partiton (aligned). The setup does it's thing and then reboots. Immediately after the reboot, there is a disk error and I am asked to hit CtrlAltDel to restart.

What am I missing?

0 Kudos
1 Solution

Accepted Solutions
Jason_O
Enthusiast
Enthusiast
Jump to solution

It seems that Windows 2003/XP do not support boot partitions with cluster sizes larger than 4K. I found this article, not exactly a definitive source but it seems that this person also ran into the same trouble. Thanks to your post, I have rebuilt my Windows 2003 templates to have the C: aligned at 64K rather than the default 31.5K. Preliminary results shows it to be a bit peppier, but I am sure that is because I haven't loaded up all the OS updates.

View solution in original post

0 Kudos
18 Replies
continuum
Immortal
Immortal
Jump to solution

sounds like you use a F6 floppy with LSI-SAS controller during setup and do not disconnect it on reboot.

If the VM then uses the default boot-option it tries to start from a unbootable floppy ...

Just fishing in the mud .. which Windows do you use ? AFAIK aligning is not necessary with Vista and higher




___________________________________

VMX-parameters- Workstation FAQ -[ MOA-liveCD|http://sanbarrow.com/moa241.html] - VM-Sickbay


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
msemon1
Expert
Expert
Jump to solution

Alignment is not needed if you are using Windows 2008 or Windows 7. If you are aligning Windows 2003 only the data partition needs to be aligned. The OS or boot partition does not need to be aligned.

Mike

Khue
Enthusiast
Enthusiast
Jump to solution

Why wouldn't you align the OS partition as well? What is the thinking behind this?

0 Kudos
msemon1
Expert
Expert
Jump to solution

I think this can explain better

http://communities.vmware.com/message/1446727#1446727

Aligning the boot disk in the virtual machine is neither recommended nor required.

0 Kudos
vmroyale
Immortal
Immortal
Jump to solution

Hello.

The quote about the boot disk alignment can be found on p.3 of the Recommendations for Aligning VMFS Partitions Performance Study.

I think the general idea here is that if you separate your OS and data partitions, then the boot volumes won't see too much of an improvement. This is assuming that nothing on the OS volume is generating a ton of disk IOps. As you are finding, it is possibly more trouble than it is worth to get the OS volumes aligned. It would be nice on new installs from templates, but any P2V systems are still going to be unaligned.

Good Luck!

Brian Atkinson | vExpert | VMTN Moderator | Author of "VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: VCP-550" | @vmroyale | http://vmroyale.com
Khue
Enthusiast
Enthusiast
Jump to solution

Yeah thats basically what I am interested in doing. Aligning a template to deploy from moving forward is the real goal. I some how managed to do it with a Windows Server 2003 Standard template and now I am trying to do the same process for a Windows Server 2003 Enterprise install. I have absolutely no idea how I got the 2003 Standard template aligned without the trouble I am having with the Enterprise Edition version. I found a .flp I had with a vmscsi.sys driver and dll and thought maybe the f6 option might be the way to go, but the driver had no affect. What's odd is that you can install Windows just fine (load cabs and drivers on to the NTFS volume) but when you go to boot, thats when it blows up in your face. It would be "cool" if I could get this to work, but I suppose not necessary.

0 Kudos
Troy_Clavell
Immortal
Immortal
Jump to solution

here's some steps on how to align your system partitons. Keep in mind this needs to be done on the RAW disk using something like WinPE. After you align your partiton, shutdown the guest, reboot and then mount the OS Media.

1. In the VI client, right click on the VM you just created in part 1, then click on edit settings.

2. In the virtual machine properties window, select CD/DVD Drive 1, then select the Datastore ISO File radio button.

3. Click on browse, explore down to the directory you have stored the WinPE ISO. Select the winpe_20.iso file, then click OK.

4. Check the ‘connect at power on’ box then click OK.

5. Right click on the VM and select Power On.

6. Right click on the VM and select open console.

7. Once the Windows Preinstall Environment has loaded (this step may take several minutes), run the ‘diskpart’ command in the open command window. Note – the WinPE utility may report a network cable error. This error can be ignored.

8. At the command prompt enter ‘select disk 0’

9. Enter create partition primary align=64

10. Exit diskpart by typing exit.

11. Shutdown the virtual machine. To properly shutdown a guest booted into an instance of WinPE you can type shutdown –s –t 0 –f

Install the operating system as normal, using the previously created partition. Note - Do not delete the previously created partition only format it as NTFS.

0 Kudos
vmroyale
Immortal
Immortal
Jump to solution

What happens if you create a new virtual machine and add this VMDK to it? Do you get the same error? This is just chasing after what Ulli posted above really, but it might be worth a shot to rule out any attached/connected devices or BIOS settings that might be causing the error.

Brian Atkinson | vExpert | VMTN Moderator | Author of "VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: VCP-550" | @vmroyale | http://vmroyale.com
0 Kudos
Khue
Enthusiast
Enthusiast
Jump to solution

The original process is as follows:

1) Create vm

2) attach vmdk to slave, align, format, detach

3) start vm with preconfigured ntfs volume

4) connect cd rom to local cd rom of VIM host

5) install windows, selecting the already preconfigured ntfs volume. no f6 required as windows identifies the storage volume to install to.

6) reboot.

As you can see f6 doesn't need to be instantiated because the windows install sees the volume by default. I could try forming an ISO of the installer and connect the vm to an ISO instead of the VIM host's cdrom to see if there is any difference but I don't know what that difference would be.

As I stated earlier, I did try to instantiate f6 using a driver I found called vmscsi.sys but that did not make a difference. Does this answer your question Royal? If not please elaborate. I am interested in your input.

0 Kudos
continuum
Immortal
Immortal
Jump to solution

5) install windows, selecting the already preconfigured ntfs volume. no f6 required as windows identifies the storage volume to install to.

wait a minute - just the fact the install.iso finds a prepartitioned disk this in no way means that the CD has the appropriate driver.

You need a F6 floppy with vmscsi-driver only for XP

Win 2000 can handle scsi0.virtualDev = "buslogic" without F6 floppy

Win 2003 can handle scsi0.virtualDev = "lsilogic" without F6 floppy

Vista can handle scsi0.virtualDev = "lsilogic" without F6 floppy

2008 can handle scsi0.virtualDev = "lsilogic" without F6 floppy

Win 7 can handle scsi0.virtualDev = "lsilogic" without F6 floppy






___________________________________

VMX-parameters- Workstation FAQ -[ MOA-liveCD|http://sanbarrow.com/moa241.html] - VM-Sickbay


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Khue
Enthusiast
Enthusiast
Jump to solution

I understand that, but the only delta here is the aligned disk. If you were to simply build a vm, point at the win2k3 ent iso, and install on reboot, everything works fine (no special driver load needed). I am more curious about why aligning the disk causes the vm to not boot.

0 Kudos
Khue
Enthusiast
Enthusiast
Jump to solution

So here is some more interesting information. On all of the scenarios listed, Windows files copied over to the hard disk. Each time this was done, f6 option was NOT CHOSEN and NO SPECIAL DRIVERS WERE LOADED. Parallel LSI Logic was used for an install of Windows Enterprise Edition 2003. Here are the following scenarios:

Using - create partition primary align=64

-Formatting the drive using 32k size allocation units: Failure after files load from iso and restart to finalize install

-Formatting the drive using 16k size allocation units: Failure after files load from iso and restart to finalize install

-Formatting the drive using 64k size allocation units: Failure after files load from iso and restart to finalize install

-Formatting the drive using default (4k I think?) size allocation units: Success after files load from ISO and restart to finalize install

Using - create partition primary align=128

-Formatting the drive using 64k size allocation units: Failure after files load from iso and restart to finalize install

-Formatting the drive using 32k size allocation units: Failure after files load from iso and restart to finalize install

-Formatting the drive using default (4k I think?) size allocation units: Success after files load from ISO and restart to finalize install

So in the end, there seems to be some limitation with formatting NTFS with anything other then the default cluster size. Still interested in some sort of explanation about this, but it's not really a vmware thing anymore. More of a Windows issue.

0 Kudos
msemon1
Expert
Expert
Jump to solution

What is the block size on your SAN?

0 Kudos
Khue
Enthusiast
Enthusiast
Jump to solution

128, vmfs is 1 meg.

0 Kudos
Jason_O
Enthusiast
Enthusiast
Jump to solution

When you format using the default 4K cluster size, is this when the VMDK is attached to the other VM or during the Windows installation?

0 Kudos
Khue
Enthusiast
Enthusiast
Jump to solution

I have actually tried it both ways and it works both ways. That is to say these 2 scenarios are valid:

-align, format with default cluster formation on work horse vm. Choose install on volume without making changes to volume (format, quick format, etc)

-align, do not format with default cluster formation on work horse vm. Choose install on volume using NTFS formatting (non quick format method)

I believe the key might be in this fact: Microsoft Windows allocates the first 63 sectors on the first track to the Master Boot Record. That means that Windows always creates partitions starting with the sixty-fourth sector. The partition is not “track aligned”; that is, the first 512 bytes of the partition is written to the last sector of the first track. The next 512 bytes is written to first sector of the second track. Partitions that span tracks create I/O performance problems.

While I can't really wrap my brain around the fact completely, I am thinking that the Operating System files are being placed in a position on the disk where Windows is not specifically looking. Because Windows cannot see whatever it initially needs to see to boot, this registers as a bad disk.

0 Kudos
Jason_O
Enthusiast
Enthusiast
Jump to solution

It seems that Windows 2003/XP do not support boot partitions with cluster sizes larger than 4K. I found this article, not exactly a definitive source but it seems that this person also ran into the same trouble. Thanks to your post, I have rebuilt my Windows 2003 templates to have the C: aligned at 64K rather than the default 31.5K. Preliminary results shows it to be a bit peppier, but I am sure that is because I haven't loaded up all the OS updates.

0 Kudos
heybuzzz
Enthusiast
Enthusiast
Jump to solution

Two questions...

If my VMFS is aligned at 128 (I check my LUNs running fdisk -lu) and my Windows guest files system c:\ is aligned at KB 64 what do I need my SAN admin to check on there side (EMC Clarion)?

Also, if I add a D:\ virtual disk to my aligned C:\ do I need to do anything special to the new added disk or is it aligned because the C:\ is? I only ask because my c:\ is aligned using v Optimizer Pro and my D:\ read "not aligned".

Thanks

0 Kudos