Tuesday, October 13, 2015

How to check file allocation unit size in windows servers

File Allocation Unit Size


Run the below command to get the drive size information and Bytes Per Cluster is the file allocation unit size.


fsutil fsinfo ntfsinfo c:
fsutil fsinfo ntfsinfo f:


C:\>fsutil fsinfo ntfsinfo c:
NTFS Volume Serial Number :       0xe42ac0022abfcfb2
NTFS Version   :                  3.1
LFS Version    :                  1.1
Number Sectors :                  0x000000000634f7ff
Total Clusters :                  0x0000000000c69eff
Free Clusters  :                  0x00000000006b9ee1
Total Reserved :                  0x0000000000000f80
Bytes Per Sector  :               512
Bytes Per Physical Sector :       512
Bytes Per Cluster :               4096          -- It shows the allocation unit size information
Bytes Per FileRecord Segment    : 1024
Clusters Per FileRecord Segment : 0
Mft Valid Data Length :           0x000000000b440000
Mft Start Lcn  :                  0x00000000000c0000
Mft2 Start Lcn :                  0x0000000000000002
Mft Zone Start :                  0x00000000000cb440
Mft Zone End   :                  0x00000000000cc820


Windows provides a tool called diskpart which is used for disk partition alignment.


C:\>diskpart
Microsoft DiskPart version 6.3.9600
Copyright (C) 1999-2013 Microsoft Corporation.
On computer: KalyanServer


DISKPART> list disk
  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online           50 GB  1024 KB
  Disk 1    Online           30 GB  1024 KB  
 
DISKPART> list volume
Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
----------  ---  -----------  -----  ----------  -------  ---------  --------
Volume 0     C   New Volume   NTFS   Simple        49 GB  Healthy
Volume 1     D   New Volume   NTFS   Simple        29 GB  Healthy

DISKPART> select volume 0
Volume 0 is the selected volume.


DISKPART> filesystems
Current File System
  Type                 : NTFS
  Allocation Unit Size : 4096
  Flags : 00000000
 
DISKPART> format unit=64k quick       -- If you want to format it to another allocation unit, Don't ever do this on your live hosts.
  100 percent completed
DiskPart successfully formatted the volume.


DISKPART> filesystems
Current File System
  Type                 : NTFS
  Allocation Unit Size : 64K                     -- After format





No comments: