Disk partition alignment

Disk partition alignment

What is Disk partition alignment?

In a SAN environment, the smallest hardware unit used by a SAN storage array to build a LUN out of multiple physical disks is a called a chunk or a stripe. To optimize I/O, chunks are usually much larger than sectors. Thus a SCSI I/O request that intends to read a sector in reality reads one chunk.

On top of this, in a Windows environment NTFS is formatted in blocks ranging from 1MB to 8MB. The file system used by the guest operating system optimizes I/O by grouping sectors into clusters (allocation units).

Also, operating systems on x86 architectures create partitions with a master boot record (MBR) that consumes 63 sectors. This is due to legacy BIOS code from the PC that used cylinder, head, and sector addressing instead of logical block addressing (LBA). Without LBA, the first track is reserved for the boot code, and the first partition starts at cylinder 0, head 1, and sector 1. This is LBA 63 and is therefore unaligned.

An unaligned partition results in a track crossing and an additional I/O, incurring a penalty on latency and throughput. The additional I/O (especially if small) can impact system resources significantly on some host types. An aligned partitions ensures that the single I/O is serviced by a single device, eliminating the additional I/O and resulting in overall performance improvement.

The performance degradation of unaligned partition occurs during intensive I/O workloads rather than on those with low to moderate I/O activity.

Partitions that are not aligned:

Partitions that are well aligned:

A good document about align problem is "Recommendations for Aligning VMFS Partitions" (This paper is now considered obsolete, but it still contain a lot of useful information):

http://www.vmware.com/pdf/esx3_partition_align.pdf

For the latest information on this topic there "Performance Best Practices for VMware vSphere® 4.0":

http://www.vmware.com/pdf/Perf_Best_Practices_vSphere4.0.pdf


Align a VMFS partition

Note that if you add a datastore using a VI Client connected directly to the ESX server or through vCenter your disk will be aligned .

For manually align a VMFS partition, see:

http://www.vmware.com/pdf/esx3_partition_align.pdf

These recommendations are for block-based storage solutions. I/O characteristics on NFS are different from those of Fibre Channel and iSCSI storage systems. Though partition alignment eliminates track crossings and benefits performance on all storage platforms, the throughput improvements in specific types of I/O between SAN, NFS, and iSCSI are different.

Note that the first VMFS volume of a ESX 4.0 could not be aligned: the reason is that the volume contain the COS vmdk, so is not possible to free the volume to do the alignment.


Align a Guest OS vmdk disk

In Windows Vista (ans Windows 7) as well as Windows Server 2008 (and 2008 R2), partition alignment is usually performed by default. The default for disks larger than 4 GB is 1 MB. See also: http://frankdenneman.nl/2009/05/windows-2008-disk-alignment/

Partitions created on versions of Windows up to and including Windows Server 2003 by default are not aligned. Partition alignment must be explicitly performed.

For Microsoft OS see also:

http://support.microsoft.com/kb/929491

http://technet.microsoft.com/en-us/library/aa995867.aspx

http://download.microsoft.com/download/C/E/7/CE7DA506-CEDF-43DB-8179-D73DA13668C5/DiskPartitionAlign...


Storage vendor notes

http://www.emc.com/collateral/software/solution-overview/h2197-vmware-esx-clariion-stor-syst-ldv.pdf

http://www.emc.com/collateral/hardware/solution-overview/h2529-vmware-esx-svr-w-symmetrix-wp-ldv.pdf

http://www.emc.com/collateral/hardware/technical-documentation/h5536-vmware-esx-srvr-using-celerra-s...

http://www.netapp.com/us/library/technical-reports/tr-3747.html

http://media.netapp.com/documents/tr-3749.pdf


More info

http://virtualgeek.typepad.com/virtual_geek/2010/06/so-why-all-the-fuss-about-alignment.html

http://tcpdump.com/kb/virtualization/vmware-esx-server/vmware-disk-alignment/intro.html

Storage Alignment and VMFS Block Sizes

http://vcommunity.vizioncore.com/administration/voptimizerpro/b/weblog/archive/2010/12/20/why-you-sh...

javascript:;

javascript:;

javascript:;

javascript:;


Specific Software

To check if your VMs are aligned you can download a free tool called VM Check Alignment available at http://ctxadmtools.musumeci.com.ar/VMCheckAlign/Default.asp

To perform alignment there are some commercial product, like Vizioncore vOptimizer Pro:

http://www.vizioncore.com/products/vOptimizerPro/features.php

Another useful tool is mbrscan/mbralign

http://blogs.netapp.com/storage_nuts_n_bolts/2009/01/mbrscanmbralign.html

New free tool (in beta phase):

http://www.vladan.fr/check-alignement-and-wasted-space-with-free-tool-from-virtualizeplanet

Comments
Version history
Revision #:
1 of 1
Last update:
‎08-09-2009 12:01 AM
Updated by: