I spend a lot of my time working with Exchange. These days it is primarily Exchange 2003 with some Exchange 2000. In my experience the most missed configuration is the alignment of partition sectors. This can lend to higher actual disk I/O resulting in poor performance. The solution is to use a utility that comes with Windows 2003 SP1 called diskpart.exe.
I often find myself asking the question, “Did you use diskpart to align you partition?”
The most common answers are “I don’t know.” or “What’s that?”. This usually means that the tracks are not aligned, but what if someone else built the server, a vendor, previous employee, etc. Then the question is not so easily answered. How to do check the actual sector alignment? I have not found any easy way to check, until now.
The ability to check the actual starting sector offset (which is the value used to align a partition) is not built-in to diskpart.exe, but it is a part of diskpar.exe. Diskpar.exe is the predecessor to diskpart.exe and was originally included in the Windows 2000 Resource Kit before diskpart.exe was ever available. No big deal, just download the now freely available Windows 2000 Resource Kit from Microsoft’s website and your good to go……not so fast! Microsoft has replaced the original diskpar.exe program with the new version, diskpart.exe. They do claim that the functionality of diskpar.exe is included in diskpart.exe and they are mostly correct, except for the ability to check the current starting sector offset.
What now? Well, to be honest I do have an original copy of the Windows 2000 Resource Kit, and I would love to make diskpar.exe available for download, but I am afraid that will cause me some unneeded attention. So, the best I can say is to dig through your old Windows CDs and find that original copy. Once you do find it, the command to check is very simple:
Here is a sample of the output and what to look for, I used my own workstation that only has one disk and one partition, so this example is simple. (BTW, notice now “infomation” is mispelled…everyone makes mistakes)
—- Drive 0 Geometry Infomation —-
Cylinders = 5169
TracksPerCylinder = 240
SectorsPerTrack = 63
BytesPerSector = 512
DiskSize = 40015503360 (Bytes) = 38161 (MB)
—- Drive Partition 0 Infomation —-
StatringOffset = 32256
PartitionLength = 40015471104
HiddenSectors = 63
PartitionNumber = 1
PartitionType = 7
End of partition information. Total existing partitions: 1
The value we are interested in is “StartingOffset“. Let me explain how to use this number. The default allocation unit size of 4 KB (or 4096 bytes), which can be set when you format the partition, is the best practice per Microsoft. 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. If we divide the StartingOffset by our default allocation unit size we should see an integer indicating read/write operations will not cross those sector boundaries.
32256 / 4096 = 7.875
7.875 is not an integer and thus this sector is not aligned. Good thing I do not have an Exchange database on this partition.
For more information on this topic, which is what I use for reference, check out this post on the Microsoft Exchange Team Blog, “You Had Me At EHLO“.
In the event that anyone has any alternate suggestions for checking sector alignment, please post a comment with some details, I would love to find a better way!