Skip to content

            Lost ?  |  Need an account:
 
Home >> Knowledge Base >> Operating Systems >> Windows >> Windows Disk Alignment - Creating new Aligned Volumes
Windows Disk Alignment - Creating new Aligned Volumes PDF Print E-mail
(4 votes, average 4.75 out of 5)
Written by Tom Hirt   
Saturday, 11 April 2009 17:34
Article Index
Windows Disk Alignment
Checking Windows Disk Alignment
Creating new Aligned Volumes
All Pages

 

Creating new Aligned Volumes


Most RAID configurations will write data in 64KB chucks (64KB = 128 sectors).  However, per Microsoft KB 929491 you should consider using an offset of at least 2048 sectors (1024 KB) to cover SAN configurations.  You're actual RAID/LUN configuration might dictate something else altogether so additional research should be made to ensure your starting sector aligns with your RAID/LUN configuration.

For most though, the 2048 sector offset is a safe bet.  We’ll use the diskpart utility to create a new partition aligned at 2048 (1024 KB) but you should double check with your SAN administrator and/or server administrator to verify the offset of your configuration.

  • Note: You must be running Service Pack 1 or later (diskpart was not included in earlier distributions)
  1. Run diskpart from the command line (start -> run -> cmd)

    C:\>diskpart

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

    DISKPART>

  2. List the disks available on your system

    DISKPART> list disk
    Disk ### Status Size Free Dyn Gpt
    ------------- ---------- ------------ ------------ ------ ------
    Disk 0 Online 10 GB 8033 KB
    Disk 1 Online 2047 MB 2047 MB
    DISKPART>


  3. Select the number of the disk you wish aligned

    DISKPART> select disk 1

    Disk 1 is now the selected disk.

    DISKPART>

  4. Create a new partition aligned at 1024KB (sector 2048)

    DISKPART> create partition primary align=1024

    DiskPart succeeded in creating the specified partition.

    DISKPART>

  5. Assign the drive a letter

    DISKPART> assign letter=e

    DiskPart successfully assigned the drive letter or mount point.

    DISKPART>

  6. Exit diskpart and format the disk using disk management.  Run compmgmnt.msc

    Run Computer Management

  7. From Disk Management, right click the new volume and select format

    Computer Management

  8. Enter your desired formatting defaults and click ok

    Format Options

  9. Confirm the format

    Format Warning Message

  10. Run the Disk Alignment Check Utility to verify the alignment of your new partition

    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

    Device ID: Disk #0, Partition #0
    =============================================
    Number Of Blocks:  20948697
    Block Size:        512 KB
    Total Volume Size: 10 GB
    Type:              Installable File System
    Starting Offset:   32256 (31.5 KB)
    Disk Alignment:    NOT ALIGNED!!

    Device ID: Disk #1, Partition #0
    =============================================
    Number Of Blocks:  4174852
    Block Size:        512 KB
    Total Volume Size: 2 GB
    Type:              Installable File System
    Starting Offset:   1048576 (1024 KB)
    Disk Alignment:    Aligned

Congratulations, you've now aligned your new volume!  Just make sure you follow this guide for any new volumes that are created with RAID and LUN volumes and you'll be able to rest easy knowing that your getting the best possible I/O performance within Windows.

 


Add this page to your favorite website
AddThis Social Bookmark Button


Comments
Add New Search
ayaz |04/12/2009 11:20:03
I have configured Raid5 array 64KB stripe size using 6 1TB enterprise class WDC drives on nVidia 3000 professional chipset (Windows 2003 x64 32GB ram, 2quad core AMD cpu)
and I've used diskpart command
create partition primary align=64
and format selecting 64KB allocation unit

and the write speed is just 35- 40MBPS and after say 30mins it drops to 2MB (megabytes). The basic test I've done is13GB(single zip file that has single 16GB file in it ) network file copy on my raid5 array and extract it locally and it took 2hours to extract.
create partition primary align=1024 gives same results
create partition primary align=5120 gives same results (i read some where to align partition as 1024 * number of drives -1 for parity block so that's 1024*5 I believe)

The volume is DATA volume thus I can destroy and create if you have any suggestions
thirt |04/01/2010 06:07:02
Hi Ayaz - I've recently done a lot of performance/benchmarking in my lab experimenting with RAID and array controller performance. A couple pointers for you:

1. It sounds like you are assuming the speed of the network will outperform your local disk. An optimally configured 1000MB/s network will theatrically max out around 112MB/s – 120MB/s. Depending on the number of spindles and performance of your hardware etc., your disk subsystem could very easily outperform the speed of your network. Therefore, you might consider using an I/O load generation tool on your system to check its performance to remove the network as part of the equation.

2. If you insist on using the network, very you have jumbo frames enabled. You’ll get much better throughput on a network that is using jumbo frames and stand a better chance at hitting the performance limitations of your disk subsystem. I’m not sure how much improvement you should expect on a simple CIFS copy/extract, but I would image you should see something.

3. Aside from the network, the disk on the source system could also be the bottleneck. It may not be able to keep up with your RAID 5 6 spindle configuration. Again, consider using a load generation tool on the local system.

Of couple of my results for comparison:
8x SAS 10K RPM in RAID 5: 249MB/s
6x SATA 7200 RPM in RAID 0: 390MB/s


I was running these tests on a RHEL 5.2 system using ‘dd’ to create a 50GB file.
John |01/02/2010 16:14:32
Nice article, do you know of any apps that have been written to fix the offset of a system already built?
Getting error |16/04/2010 22:32:08
Hi,

While running the Disk align I am getting VBScript runtime error "Overflow: '[string : "31453470720"]'.
Any help would be appriciated.

Thanks
Harish
Zeniumtech |22/04/2010 00:13:28
Regarding overflow problem. I found a fix at this site:

http://blogs.msdn.com/ericlippert/archive/2004/12/01/integer-arithmetic-in-vbscript-part-one.aspx

Tried out the myMod function and no more overflow on my 250 GB drive. Don't have a 1TB or 2TB drive so have not tested that large of number.
harish |22/04/2010 08:27:49
Hi,

Thanks a lot. It worked with MyMod. I have tested on 1 TB HDD and it works. I will try on 2TB and let you know.

Thanks
Harish
Madhatterpa  - Please post updated vbs file for large disks |28/05/2010 22:41:03
I'm having the same issue with overflow. Can you please post or let us know how you modified the align.vbs script go use the MyMod function. Thanks
Harish |19/07/2010 09:48:09
Please confirm if you still require the modified script.

Thanks
Harish
superunknown |23/07/2010 08:48:10
Harish, can I have the modified script? Thanks..
Bob_Carswell |17/08/2010 09:38:07
This VB script is really useful but as above I'm having the same issue with overflow and would appreciate knowing how to modified the align.vbs script to use the MyMod function or have access to an already modified version.

Thks
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:D:):(:0:shock::confused:8):lol::x:P:oops::cry::evil::twisted::roll::wink::!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Last Updated on Tuesday, 23 June 2009 15:23
 

Forum Activity

Author: helenaprincesss
Aug.21.10
Author: helenaprincesss
Aug.21.10
Author: iinfotech10
Jul.30.10
Author: thirt
Jun.17.10
Author: data2020
May.28.10

Online Stats

Guests Online: 32
Members Online: 0



We thank you for visiting TcpDump and hope you find our knowledge base articles helpful. However, we need your support!!

If you found the content on our site useful, please help support us and visit one of our sponsors sites. Your support pays for the electric, servers and bandwidth required to run TcpDump and we can’t do it without your help!

Thank you again for all your support!

Best Regards,
-Tom Hirt