Checking Partition Alignment with PowerShell

By: Justin Braun
Posted on: July 21, 2009

Here is an easy way to determine the partition alignment of any given disk on the local system or remotely.

$OffsetKB = @{label=”Offset(KB)”;Expression={$_.StartingOffset/1024 -as [int]}}
$SizeMB = @{label=”Size(MB)”;Expression={$_.Size/1MB -as [int]}} 
 
Get-WmiObject -ComputerName "localhost" -Class "Win32_DiskPartition" | ft`
SystemName, Name, DiskIndex, $SizeMB, $OffsetKB  -AutoSize

This will output table that looks like this:

image

Why should you care about this?  This is particularly useful for determining partition alignment of existing disks that may be running applications like Exchange or SQL.  Exchange recommends a 64K partition alignment as does SQL in most cases.  In Windows Server 2008, partition alignment is automatic and defaults to 1024KB for new partitions. Note that the alignment of partitions on servers that were upgraded from Windows 2003 to 2008 are not changed.

Related Articles

Slow RDP Performance from Vista to Windows Server 2003

I have one Windows Server 2003 box in my environment that connects fine through RDP, but once I star

Windows Vista Speech Recognition

I was in Seattle this past week, and I got to thinking about the advancements in speech recognition.
665

PowerShell One-Liner: SC Series storage class and RAID level allocations

With the PowerShell SDK for Dell EMC SC Series arrays, you can easily retrieve volume information including allocated, free, and used space.