Disk Partition Alignment

Why do you Want your Partitions to be Aligned?





Measurable Goal



Partition_Offset ÷ Stripe_Unit_Size = Integer
Stripe_Unit_Size ÷ File_Allocation_Unit_Size = Integer




File Allocation Unit Size



FSUTIL.EXE
C:\>fsutil fsinfo ntfsinfo c:NTFS Volume Serial Number :       0x88d8c401d8c3eb8eVersion :                         3.1Number Sectors :                  0x0000000003a657ffTotal Clusters :                  0x000000000074caffFree Clusters  :                  0x00000000002836f6Total Reserved :                  0x0000000000000040Bytes Per Sector  :               512Bytes Per Physical Sector :       <Not Supported>Bytes Per Cluster :               4096Bytes Per FileRecord Segment    : 1024Clusters Per FileRecord Segment : 0Mft Valid Data Length :           0x0000000004740000Mft Start Lcn  :                  0x00000000000c0000Mft2 Start Lcn :                  0x0000000000000002Mft Zone Start :                  0x00000000004df9e0Mft Zone End   :                  0x00000000004ec200RM Identifier:        1D9A9C5B-505C-11E0-8B5F-005056A4000A



Partiton Offset


Method 1: WMIC.EXE
wmic partition get Name, BlockSize, StartingOffset,  sizeBlockSize  Name                   Size          StartingOffset512        Disk #0, Partition #0  41094144      32256512        Disk #0, Partition #1  786432000     41943040512        Disk #0, Partition #2  499275268096  828375040
Method 2: DISKPART.EXE


C:\>diskpart
Microsoft DiskPart version 6.1.7600
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: GREENDALE


DISKPART> list disk
  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          120 GB    90 GB


DISKPART> select disk 0
Disk 0 is now the selected disk.


DISKPART> list partition
  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Primary            100 MB  1024 KB
  Partition 2    Primary             29 GB   101 MB


DISKPART> exit
Leaving DiskPart...
Method 3:  VB Script
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _    "SELECT * FROM Win32_DiskPartition",,48)
For Each objItem in colItems
    Wscript.Echo "Disk: " & objItem.DiskIndex & "  Partition: " & objItem.Index & "  StartingOffset: " & objItem.StartingOffset/1024 & "KB"    Wscript.Echo
Next


Creating Alligned Partitions in VMware

  1. Use the VI Client to create VMware VMFS partitons.
  2. In Windows VM - Use DISKPART.EXE to create partitions
    • Diskpart
      list disk
      select disk <DiskNumber>
      create partition primary align=<Offset_in_KB>
      assign letter=<DriveLetter>
      format fs=ntfs unit=64K label="<label>" nowait
  3. In Windows VM - Format partitions with a 32k allocation unit size


References






Comments