How to find disk block size in Powershell?

Powershell helps in fetching the block size of the disk volumes in the computer. We can use Powershell cmdlets on a local or remote computer to get the block size of a disk volume within the computer. We look at the multiple ways by which we can use Powershell to find the disk volume’s block size.

To find the disk information, please initiate a Powershell session with administrative privileges. So, run Powershell as an administrator.

Find NTFS block size using fsutil command in Powershell

The Fsutil command is available in Powershell to find all the significant details of a computer’s disk volume. Fsutil can be used through the generic command prompt or through the Powershell environment to execute the fsutil command.

Use the following fsutil command in Powershell to get disk details. From the details, we need to pick the ‘Bytes per Cluster’ as the value of ‘Bytes per Cluster’ corresponds to the NTFS block size.

We share a fsutil command report for checking the ntfs block size for the C:.

fsutil fsinfo ntfsinfo c:\

The command above will get the disk details for the C: drive. The output of this command is shared below as a screenshot. We are, particularly, interested in getting the information contained in the field ‘Bytes per cluster’. It has been highlighted in the command output shared below.

fsutil to get disk size in Powershell

We can see from the command output that the block size for C: is 4096 bytes or 4 KB.

We will look at additional methods by which you can get the block size of disk volumes in Powershell.

Find Block size of disk using WMI Object

WMI Object can be used to find all the disk details. For this to happen, WMI Object will work on the Win32_Volume class. The command that can be used to get the block size of the disk volume is mentioned below:

get-wmiobject win32_volume | Select-object Name, Filesystem, Blocksize

The command output for this WMIObject cmdlet is given below in the form of a screenshot.

Disk block size using WMI Object in Powershell

Disk block size using CIM Instance in Powershell

Similar to the WMI Object directive, the CIM Instance directive uses the Win32_Volume class to fetch disk details of the computer. The command output is almost a replica of the WMI Object’s output.

The exact command for getting the block size of a disk using the CIM Instance directive is shared hereunder:

get-ciminstance win32_volume | Select-object Name, Filesystem, Blocksize

The output of this command is shared below as a screenshot. From the command output, you can see that the disk block size for C: and D: is 4096 bytes or 4 KB. The output matches the command output of the fsutil command.

Disk block size using CIM Instance directive in Powershell

Summary

In this Powershell tutorial, we have discussed three ways by which we can the information about the block size of a disk volume on the computer. We can use the fsutil command, WMI Object directives or the CIM Instance directives to fetch information about the block size of a disk volume in the computer.

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Rajesh Dhawan

Rajesh Dhawan is a technology professional who loves to blog about smart wearables, Cloud computing and Microsoft technologies. He loves to break complex problems into manageable chunks of meaningful information.