Geeks With Blogs
Technically Speaking All in on IT

From the You Had Me At EHLO Exchange blog (who knew?):

Why should you use Diskpar (Diskpart in W2003 SP1)?

Exchange Server can benefit from having basic disk partitions track-aligned.  Diskpar.exe is used for aligning a partition at the storage level, which, if used to create the partition, can have a significant positive performance impact on the storage and is highly recommended.   Before I go into the details of how to do this, I’ll give some basic definitions.  A partition is the container you create on an initialized disk to format and then use. Multiple partitions can be created on a single physical disk, and each partition will function as a separate disk (even though the partition will appear to be a separate disk, the total throughput of the physical disk is unchanged – so if you make two partitions on each disk and use them equally, they will each effectively only have half the available i/o rate.  This is important to keep in mind for capacity planning).   A sector is the smallest accessible unit on a physical disk, with multiple sectors comprising a track.  A partition that is track misaligned will occasionally cause 2 I/O operations instead of one depending on the actual drive geometry.


Even though some storage obfuscates sectors & tracks, using diskpar will still help by preventing misalignment in cache, or wasted cache.  If the disk is not aligned, every Nth (usually 8th) read or write crosses a boundary, and the physical disk must perform two operations.  At the beginning of all disks is a section reserved for the master boot record (MBR) consuming 63 sectors.  This means that your partition will start on the 64th sector, misaligning the entire partition.  Most vendors suggest a 64-sector starting offset, meaning that your partition starts on the 65th sector vs the standard 64th.  Check with your particular vendor before standardizing this setting on a particular storage array.  The key is to have it aligned on a 4 KB boundary from the start of the disk, of which choosing 64 sectors is 32 KB, and aligned.  (64 * 512 bytes per sector = 32,768 bytes)


It is important to differentiate the sector alignment, with file level fragmentation and allocation unit size.  Most Exchange Server I/O is random 4 KB read & write to the database .edb file.  We don’t notice a huge statistical difference in normal file fragmentation on a database LUN.  Since Exchange best practice is to place all database files in a storage group on the same LUN, as they grow, they will fragment each other pretty severely.  I have only heard of one case where serious file-level fragmentation impacted Exchange, and that was when a customer ran a 3rd party application on the same partition as the database files, and it created/deleted millions of very small files in a day.  If you dismount the databases, and perform an offline defrag, one database at a time, you will eradicate the file level fragmentation, but the performance win would be nearly immeasurable.  It is not recommended to have any other files on the exchange database or log partitions (it is especially important not to share the log partitions with other programs, since log access to the drive is sequential, and random access to the drives hosting the drive will significantly reduce the performance.)


Exchange accesses the database file (edb) in random 4 KB read/write, which is, by default, the allocation unit size on the partition.  The default allocation unit size of 4 KB, which can be set at partition format, is the best practice.  If you use the default allocation unit size of 4096 bytes and have a starting offset that is a multiple of 4096 bytes, then your partition will always align on a 4 KB boundary. Setting the allocation size to be larger than 4 KB will disable NTFS compression [Exchange log and database files should always be uncompressed], and is useful in rare streaming backup solutions of extremely large databases where a larger allocation unit size will increase backup speed.




You have 2 switches, (i)nfo, and (s)et, and a parameter.  The parameter which you must add is the disk number.  This is discernable in disk manager (diskmgmt.msc)


1) First I query the disk and notice that the starting offset is 32256 bytes, which is not aligned.

C:\>diskpar -i 2


---- Drive 2 Geometry Infomation ----


Cylinders = 13056

TracksPerCylinder = 255

SectorsPerTrack = 63

BytesPerSector = 512

DiskSize = 107389255680 (Bytes) = 102414 (MB)


---- Drive Partition 0 Infomation ----


StatringOffset = 32256

PartitionLength = 107380998144

HiddenSectors = 63

PartitionNumber = 1

PartitionType = 7

2) Notice 32256 / 4096 = 7.875 , which is not an integer.   We want to change this to improve performance.

3) Now I set it to 64 sectors, and select the full available partition size.

C:\>diskpar –s 2            (yes, it’s really this easy)


---- New Partition information ----

StatringOffset = 32768

PartitionLength = 107388862464

HiddenSectors = 64

PartitionNumber = 1

PartitionType = 7

4) Now we get 32768 / 4096 = 8. Yeah!

5) Now open up disk manager and format the drive.




In Windows 2003 SP1, diskpart.exe has included diskpar.exe functionality.  The main difference is that diskpar creates a partition in sectors (512byte), and diskpart uses kilobytes.  In the example below we take a disk w/o any partitions and create it with the same starting offset of 32768 as the above diskpar.exe example.


Microsoft DiskPart version 5.2.3790.1830

Copyright (C) 1999-2001 Microsoft Corporation.

On computer: Exchange2003


DISKPART> select disk 1


Disk 1 is now the selected disk.


DISKPART> create partition primary align=32


DiskPart succeeded in creating the specified partition.





3rd Party:


- Robert Quimbey

Posted on Thursday, August 11, 2005 5:43 PM | Back to top

Comments on this post: Why You Should Use Diskpar

# re: Why You Should Use Diskpar
Requesting Gravatar...
Hi Robert,

I'm in the process of adding iSCSI storage to a Windows 2000 Server. I'm trying to align the disk sectors but diskparT will not allow me to do so on a 2000 box. I am unable to find DISKPAR anywhere. MS insists it's on their website but their 2000 Resource Kit includes diskparT and not diskpar... any ideas?
Left by Chris on Mar 11, 2008 10:12 AM

# re: Why You Should Use Diskpar
Requesting Gravatar...
try this link..
Left by teo on Apr 28, 2008 10:37 AM

# re: Why You Should Use Diskpar
Requesting Gravatar...

Would help if I wrote the link on the right place :D
Left by teo on Apr 28, 2008 10:39 AM

# re: Why You Should Use Diskpar
Requesting Gravatar...
This is a very well written article.
Easy to follow.
I am happy that I came across this.
Thank you.
Left by dll on Mar 14, 2009 10:44 AM

# re: Why You Should Use Diskpar
Requesting Gravatar...
second partition ? any idea how to create a second aligned partition ?

winxp2sp2->diskpart appears unable to align partitions on 32kb / 64sector boundaries.

Left by brian the snail on Mar 18, 2009 4:45 AM

# seo agency
Requesting Gravatar...
A Leading & Strategic (SEO) Agency Providing SEO Marketing Search Engine Optimization, Internet Marketing Services, Website Promotion, Pay Per Click (PPC) Management Services.
Left by Alex on Apr 27, 2010 7:30 PM

# Airport Transportation Seattle
Requesting Gravatar...
Des A Plus Town Car provides luxury SeaTac airport town car service to & from Seattle, Bellevue, Redmond, Kirkland, and Tacoma at affordable rates.
Left by aplustowncar on Apr 27, 2010 11:41 PM

# Airport Transportation Seattle
Requesting Gravatar...
A Plus Town Car provides luxury SeaTac airport town car service to & from Seattle, Bellevue, Redmond, Kirkland, and Tacoma at affordable rates.
Left by aplustowncar on May 05, 2010 7:31 PM

# Taxation
Requesting Gravatar...
Trade IN EU is an independent India-EU consulting firm to help your company to develop a sustainable logistics schema and to recognize tangible eco-efficient supply chain measures.
Left by Axtion on May 20, 2010 6:30 PM

# re: Why You Should Use Diskpar
Requesting Gravatar...
It appears that you've put a good amount of effort into your article and I want a lot more of these on the World Wide Web these days. I sincerely got a kick out of your post. I do not have a bunch to to say in response, I only wanted to register to say remarkable work.
Left by Lasik Surgery on May 23, 2011 10:40 PM

# re: Why You Should Use Diskpar
Requesting Gravatar...
Today Speed Kings brings you a News for our fellow car lovers and a guide to hit the Road with these extreme mean machines but they are the best so keep looking for new posts.
Left by Kia Motors on May 23, 2011 10:41 PM

# re: Why You Should Use Diskpar
Requesting Gravatar...
Давайте будем оптимистами - продвижение неизбежно наступит.
Left by Loo on Jul 05, 2011 11:25 PM

# Seattle town car services
Requesting Gravatar...
Allstate Towncar Services provides top-notch sedans and Limousines and is committed to passenger safety, customer satisfaction and personalized service.
Left by Sachin on Jul 30, 2011 7:29 AM

# ranger
Requesting Gravatar...
where a larger allocation unit size will increase backup speed.
Left by medical billing and coding exper on Sep 07, 2011 7:39 PM

Your comment:
 (will show your gravatar)

Copyright © Chris Haaker | Powered by: