Aligning SAN disks volumes in Windows Server to improve performance

29 Aug

For those who have been involved with SAN-attached Windows server 2000 or 2003 would be familiar with aligning the volumes before provisioning them for Windows use.

In Windows 2000 or 2003, before we start partition a SAN for use by Windows, we need to change the starting offset to prevent performance issues with multiple disks. For the EMC SANs, we would align all of SAN to 1024 kb with the following command in diskpart (when N is the disk number and X is a any drive letter), before we format them:

select disk N
create partition primary align=64
assign letter=X

In Windows 2008, in general, this requirement is not required and you need to align the disk offsets before you format the disks for use.

MS KB ->

Here is the KB from EMC (unfortunately if you don’t have an account with them, you will not be able to find the other links and I don’t have.)

How to use DISKPAR to ensure track alignment for better performance in Windows operating systems

ID: emc56324
Usage: 190
Date Created: 08/22/2002
Last Modified: 10/30/2008
STATUS: Approved
Audience: Customer

Knowledgebase Solution

Question: How to use DISKPAR to optimize track alignment
Question: Performance Tuning for Microsoft Windows
Environment: OS: Microsoft Windows NT
Environment: OS: Microsoft Windows 2000
Environment: OS: Microsoft Windows Server 2003

Root Cause: The default behavior for Windows NTFS filesystem is Windows 2000 and Windows 2003 always creates the partition starting at the 64th sector (for example, hidden sectors from 0 to 63), thus misaligning it with the underlying physical disk.

Fix: For Microsoft Windows 2008, as long as you formatted the disk using the Windows 2008 operating system, the disk requires no further alignment actions.

For Microsoft Windows 2003, refer to knowledgebase solution emc104675.

For Microsoft Windows 2000:
EMC and Microsoft recommend a starting offset of 64KB (128 sectors).
EMC and Microsoft recommend a volume NTFS allocation size of 4096 (Exchange 2000 and 2003), 8192 for Exchange 2007 64KB for SQL.

Diskpar.exe is a Microsoft tool available in the Windows 2000 resource kit companion CD. This tool has the ability to explicitly set the starting offset in the master boot record (MBR). By setting the starting offset, one can ensure track alignment and improve disk performance. Microsoft Sharepoint uses 4 KB I/O and SQL 7.0 and SQL 2000 use 8 K pages, while Microsoft Exchange 2000 and Exchange 2003 server write data in multiples of 4 KB I/O (4 KB for the databases and up to 32 KB for streaming files). It is important that the starting offset be a multiple of 4KB. Failure to do so may result in a single I/O spanning two tracks causing performance degradation.

Note: Diskpar is no longer supported with Windows 2003. Customers should be using the built in Windows 2003 SP1 command “diskpart align.” Refer to knowledgebase solution emc104675 for more information.

To set the starting offset and create the first partition on disk X:
1. If disk X is a raw drive, skip to step 3. If disk X has data that you would not like to lose, back up that data.

2. Delete all partitions on disk X making it a raw disk.

3. Issue diskpar •s X (where X is the drive number) from the command line. You can obtain the drive number by using the SYMINQ command or by using Disk Manager.

4. Make sure that the device you are going to partition is a raw device and that all partitions have been deleted from the device. You can delete any existing partitions using Disk Manager.

5. Confirm that this is the drive you would like to partition.

6. Enter the new starting offset (in sectors) and the partition length (in MB). This will write the new offset to the MBR for that drive and create the partition. To determine the starting offset for an Exchange or Sharepoint device, select an offset that is some multiple of 4 KB. Exchange writes I/O in 4 KB blocks and no more than 32 KB per track. For SQL, use 8KB multiples. After you enter the starting offset and partition size, the MBR is modified and the new partition information appears.

7. Issue the diskpar •i X (where X is the drive number) command at the command prompt to review the information on the newly created partition.

8. Use Disk Manager to format the partition that was just created. When formatting this partition, make sure that NTFS is selected as your file system and the allocation unit size is 4096 for Exchange and Sharepoint or 64kb for SQL. Having the allocation unit size set to 4096 bytes (or 64kb for SQL) and having the starting offset at 64kb [128 sectors]), ensures that this partition always aligns on the proper boundary.

Leave a comment

Posted by on August 29, 2010 in Windows


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: