Skip to content

Get allocation unit size with PowerShell

The allocation unit size or named block size of a partition is vital for the systems. Think about the system performance. A partition is default formatted with a standard 4 KB allocation unit size. It does not mean that it’s the best practice. Microsoft recommends that partitions have a 64 KB allocation unit size for Exchange Server mailbox databases and log files. In this article, you will learn how to find the partitions allocation unit size with PowerShell.

Allocation unit size

Before we start to find the partition allocation unit size or named block size, it’s good to know the difference between:

  • Disk
  • Volume
  • Partition

A disk has one volume, which can be split into multiple partitions.

For example, you have a 100 GB disk. It means that the volume is 100 GB. You can split the 100 GB volume into partitions of the size 20 GB, 20 GB, and 60 GB. Thus, you will have one or more partitions. In every partition, you can set a different allocation unit size.

Note: You can set the allocation unit size differently in every partition.

Allocation unit size in Disk Management

It’s not possible to get the allocation unit size within Disk Management.

Get allocation unit size with PowerShell Disk Management

Get allocation unit size with PowerShell

We like to get the allocation unit size on all the partitions of the Exchange Server. Run PowerShell as administrator and run the Get-CimInstance cmdlet.

PS C:\> Get-CimInstance -ClassName Win32_Volume | Select-Object Name, FileSystem, Label, BlockSize | Sort-Object Name | Format-Table -AutoSize

Name                                              FileSystem Label     BlockSize
----                                              ---------- -----     ---------
\\?\Volume{ead5bb63-97c2-4c3d-9a26-5044dbe8a400}\ NTFS       Recovery       4096
\\?\Volume{fc3c8ba3-eef9-4f17-9170-7373f2d37128}\ FAT32                     1024
C:\                                               NTFS       OS             4096
D:\
E:\                                               ReFS       DB01 Data     65536
F:\                                               ReFS       DB01 Logs     65536
G:\                                               ReFS       DB02 Data     65536
H:\                                               ReFS       DB02 Logs     65536
Q:\                                               NTFS       Queue         65536

BlockSize 65536 = 64 KB allocation unit size. BlockSize 4096 = 4 KB allocation unit size.

Here is an explanation of every partition:

  • Recovery partition is hidden and created by default when you install an Operating System (OS)
  • System partition is hidden and created by default when you install an Operating System (OS)
  • OS partition is the Operating System (OS)
  • DB01/DB02/DB03/DB04 Data and Logs partitions are the Exchange database data and logs

Read more: Configure ReFS volume Exchange 2013/2016/2019 »

Conclusion

You learned how to get the allocation unit size with PowerShell. If you have an Exchange Server, ensure the block size is 64 KB for the mailbox database and log files. It’s important to have the correct configuration for an optimal Exchange Server.

Did you enjoy this article? You may also like Exchange database best practices. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *