dbatools is a free PowerShell module with over 100 SQL Server administration, best practice and migration commands included.


Test-DbaDiskAlignment

This command verifies that your non-dynamic disks are aligned according to physical constraints.

Returns $true or $false by default for one server. Returns Server name and IsBestPractice for more than one server.

Specify -Detailed for additional information which returns some additional optional “best practice” columns, which may show false even though you pass the alignment test. This is because your offset is not one of the “expected” values that Windows uses, but your disk is still physically aligned.

Please refer to your storage vendor best practices before following any advice.

Also, thanks goes out to Argenis Fernandez from Pure Storage for his help with this command.

Screenshots

Test-DbaDiskAlignment1

Examples

To test the disk alignment of a single server named sqlserver2014a

Test-DbaDiskAlignment -ComputerName sqlserver2014a

To test the disk alignment of mulitiple servers

Test-DbaDiskAlignment -ComputerName sqlserver2014a, sqlserver2014b, sqlserver2014c

To see the details about the disk alignmenet calcualtions from multiple servers

Test-DbaDiskAlignment -ComputerName sqlserver2014a, sqlserver2014b, sqlserver2014c -Detailed

References

Disk Partition Alignment Best Practices for SQL Server – A great article and behind most of this code.

Getting Partition Offset information with Powershell – Thanks to Jonathan Kehayias!

Decree: Set your partition Offset and block Size – make SQL Server faster – Thanks to Jen McCown!

Disk Performance Hands On – Thanks to Kendal Van Dyke!

Get WMI Disk Information – Thanks to jbruns2010!

Author

This command was created by Constantine Kokkinos. You can find Constantine on Twitter, constantinekokkinos.com and LinkedIn.

From PowerShell, execute   Get-Help Test-DbaDiskAlignment -Detailed   for more information on this function. Want to see the source code? See it on GitHub