Wednesday, September 25, 2013

How-to: Check cluster size configuration on an existing drive

This post was formerly published at my beloved old blog "On the quest of a DBA's adventure......"

One of the best practice that, when preparing for hard drives which SQL server is going to utilise for storing the data file, log file and tempdb files, DBA should ensure that these drives are format with cluster size to be set to 64kB instead of the default NTFS value, which is 4kB.  Here is the background: Disk Partition Alignment Best Practices for SQL Server.

OK, how about if you just start a new job and would like to do a sanity check on what are you facing?To check the cluster size of an existing drive, this is the command:

fsutil fsinfo ntfsinfo C:

This is what the output look like:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
C:\Windows\system32>fsutil fsinfo ntfsinfo C:
NTFS Volume Serial Number :      0x3cc4654e561810d1
Version :                         3.1
Number Sectors :                  0x000000001116389f
Total Clusters :                  0x000000000222c713
Free Clusters  :                  0x0000000000c2cccb
Total Reserved :                  0x0000000000000040
Bytes Per Sector  :               512
Bytes Per Physical Sector :       <Not Supported>
Bytes Per Cluster :               4096
Bytes Per FileRecord Segment    : 1024
Clusters Per FileRecord Segment : 0
Mft Valid Data Length :           0x0000000005e40000
Mft Start Lcn  :                  0x0000000000000004
Mft2 Start Lcn :                  0x0000000001116389
Mft Zone Start :                  0x0000000000005e40
Mft Zone End   :                  0x0000000000011020
RM Identifier:        B9CC8B49-4513-11E0-8641-806E6F6E6963

C:\Windows\system32>

The highlighted row is exactly what we are looking for, the cluster size of my C: drive is 4kB ( ie. 4 x 1024 btyes). I wish I would not see the same number when I run the command against the data and log file drive.....

No comments:

Post a Comment