Author | Constantine Kokkinos (@mobileck), constantinekokkinos.com |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Test-DbaDiskAlignment on GitHub.
Want to see the Bill Of Health for this command? Check out Test-DbaDiskAlignment.
Verifies that your non-dynamic disks are aligned according to physical constraints.
Verifies that your non-dynamic disks are aligned according to physical constraints.
Returns one row per computer, partition and stripe size with.
Please refer to your storage vendor best practices before following any advice below.
By default issues with disk alignment should be resolved by a new installation of Windows Server 2008, Windows Vista, or later operating systems, but verifying disk alignment continues to be recommended as a best practice.
While some versions of Windows use different starting alignments, if you are starting anew 1MB is generally the best practice offset for current operating systems (because it ensures that the partition offset % common stripe unit sizes == 0 )
Caveats:
Test-DbaDiskAlignment
[-ComputerName] <DbaInstanceParameter[]>
[[-Credential] <PSCredential>]
[[-SqlCredential] <PSCredential>]
[-NoSqlCheck]
[-EnableException]
[<CommonParameters>]
PS C:\> Test-DbaDiskAlignment -ComputerName sqlserver2014a
Tests the disk alignment of a single server named sqlserver2014a
PS C:\> Test-DbaDiskAlignment -ComputerName sqlserver2014a, sqlserver2014b, sqlserver2014c
Tests the disk alignment of multiple servers
The target computer or computers.
Alias | |
Required | True |
Pipeline | true (ByValue) |
Default Value |
Specifies an alternate Windows account to use when enumerating drives on the server. May require Administrator privileges. To use:
$cred = Get-Credential, then pass $cred object to the -Credential parameter.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.
Alias | |
Required | False |
Pipeline | false |
Default Value |
If this switch is enabled, the disk(s) will not be checked for SQL Server data or log files.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |