I have been sloppy with my posts lately, and got a question how to fix the ‘Allocation Unit Size’ problemt if you are installing a SQL Server. My last post on this topic only described how to detect, but not fix the problem. To detect an invalid ‘Allocation Unit Size’ for a disk on a SQL Server (or other server for that matter), you use several methods:
My powershell function GetDiskAllocUnitSizeKB, described here.
DOS command: “fsutil fsinfo ntfsinfo <drive:>“. This command is shown in screenshot below with the specific field of interest in “Bytes Per Cluster“.
The same information can also be found by right-clicking on the disk in Windows Explorer and select “Format…”. There you have the current “Allocation Unit Size” as the same number retrieved from fsutil command.
If you want to reformat the disk with a different block size, you choose another value in the “Allocation Unit Size” combo-box and Quick format the disk (OBS! will erase the complete disk). You can also use the command-line to format the disk. For my case above, I should use the following command to format my E: drive with 64K block size.
format E: /FS:NTFS /V:DATA /Q /A:64K
Now, you have a disk partition with 64K block size suitable for large SQL Server files.
Please do not test these command on you local laptop – use a virtual machine 🙂