Monday, June 16, 2008

SBS 2003 Boot Camp - Partition Alignment

The Brisbane SBS Users Group recently (as in yesterday) held an SBS 2003 Boot Camp. This was a day when about 25 members sat together in the Microsoft offices (thanks to Peter Fitzsimon who regularly goes above and beyong the call of duty) and all gave of their time and knowledge to create a "Best Practices Installation and Configuration" document. We sat there with our colleagues and competitors and worked as a community, learning from each other, teaching each other, and having a good (geeky) time.

One point I raised was the use of DiskPart (and DiskPar) to align the partitions on the hard drive, something which no-one else seems to do and very few people knew anything about. So here's my reasoning behind it...

In Windows 2003 and below, Microsoft uses the first 63 sectors of a hard drive to store volume information. Most hard drives have 64 sectors per track, at least on the inner zones of the drive, and the unfortunate result of this is that Windows 2003 and earlier by default start the first partition at the next sector - the last sector on a track instead of leaving this 512-byte sector empty and aligning the partition with the start of the next track.

Windows Vista and Windows 2008 both address this unfortunate behavior and align the beginning of partitions to a 1024 KB boundary. And it is about time!

Anyway, the reason I align partitions to tracks is because of a) Exchange and b) SQL tuning. Both servers write sequential data and need high-performing disk subsystems. Any Exchange and/or SQL tuning guide will tell you to align the partitions. Most tell you to use 64-disk arrays and to put the different stores and the logs all on different spindle sets. In SMBland, we don't have the pleasure of a 64-disk array nor 7 different spindle sets in our single server solution, so a number of these tuning tips are not applicable for our end of the world.

Partition alignment most definitely is applicable, is easy to do, and will result in increased performance - especially from streaming data such as Exchange and SQL use.

The speed improvements claimed tend to be between 20% and 40% once partitions are aligned. Whilst we've not seen those figures here, we've seen 10% and higher when we've tested disk subsystems once aligned. And 10% increased performance *for free* is not a bad thing, in our books!

When we perform a system install, we use a PE disk to boot from (pick whichever one you're comfortable with) and load any relevant RAID controller drivers. We then run "diskpart -i" (diskpart can be found here) to determine the current offset. An alternative to this is to use the handy little VBS Script that Bob Duffy wrote that can be found here.

Obviously if the first partition is correctly aligned (which is extremely rare) we leave sleeping dogs lie...

In Disk Management, confirm the disk number that you wish to manipulate, then in the "diskpart" CLI interface, type:

select disk n [and no, I'm not going to explain what "n" is here]
detail disk [which should show an empty partition table, if not, then you need to remove these partitions]
create partition primary size=n align=32 [where size is in MB, if empty, the whole disk is used and the align number is the number of KB to offset from the beginning of the drive]

Re-run "diskpart -i" or Bob's script to see that all's gone well.

There's a *lot* of other information on the Internet about partition alignment that I'm not going to repeat here, however here are a few of the good links (and there's a lot more):

MSExchange.org
MS KB 300415
MS KB 929491
TechNet
MessagingTalk.org
MS Exchange Team Blog
Hewlett Packard
VMWare Communities

Regards,

The Outspoken Wookie

2 comments:

Brian Williams said...

Hi Hilton,

Great post.

Did the user group complete the "best practice" guide?

If so, where can I get a copy?

Thanks Hilton,
Brian

Hilton Travis said...

HI Brian,

Due to the number of UG members who were willing to give their time and knowledge to this Best Practice Guide purely because it was stated that this guide would not be released beyond the borders of the Brisbane UG members, this Guide will not be available to anyone who isn't a financial member of the Brisbane UG.

As many people gave up "tricks of the trade" that they use to better configure their clients' SBS boxes, I'm sure you can understand that some of these people don't want to have this information made available to all.

Some of the input I gave, which I'm happy to make public, is shown in these "SBS 2003 Boot Camp" blog posts I've made. Other suggestions and information is in articles on the http://www.QuarkIT.com.au/ website, and others is in the many newsgroups I contribute to.

I'll also post more here as I come across it and as I feel I have something to say. :)