8

I want to reformat an exFAT USB drive with the same allocation size as the current factory exFAT partition, so when it ask me for allocation size, I don't know what to answer:

Cluster size in format dialog

Thus the question: How can I check the sector size of an exFAT partition on Windows? For example, on Linux you'd do:

echo print all | parted /dev/sda

Output:

GNU Parted 3.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print all
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 107GB
Sector size (logical/physical): 512B/512B
  • Here it says sector size 512 bytes.
r2d3
  • 4,050
hanshenrik
  • 1,925
  • 3
  • 25
  • 38

3 Answers3

6

Sector size is more related to physical disk drives than partitions/volumes because file systems in partitions will combine sectors together into clusters instead. The "Allocation unit size" in your screenshot is the cluster size and not sector size!!! To check cluster size see Check the cluster size of an exFAT drive on Windows

Anyway reformat the drive with the same allocation size as the current factory exFAT partition is pointless because allocation unit size has nothing to do with the sector size and depends on your data. For example if you store mostly large media files then choose big allocation size for better performance, and if you use the drive mainly for very small files then you need to choose a small allocation size, otherwise the overhead will be large and things like this will happen

it appears to be one of those fake-capacity chinese USB sticks with firmware crafted to fake capacity, it REPORTS 8TB, but files get corrupted when i tried moving 200GB to it, so it's real capacity is <=200GB

Most fake-sized crappy USB sticks are not even 4GB, let alone 200GB. There's no chance for you to get the data back. Most likely when you write more than the drive's size it already wraps back to the start and overwrite the metadata of the filesystem, making the sector size appears large but it's actually isn't. And you can't find a way to reflash the drive's firmware to get the real size either, so just throw it away


Again, you should just care about cluster size and shouldn't be worry about sector size, but if you're really curious then there are lots of ways to obtain sector size, one of that is by querying WMI with wmic

C:\> wmic diskdrive get DeviceID,BytesPerSector,DefaultBlockSize,MinBlockSize,MaxBlockSize
BytesPerSector  DefaultBlockSize  DeviceID            MaxBlockSize  MinBlockSize
512                               \\.\PHYSICALDRIVE0

or Get-WmiObject in PowerShell

PS C:\> (Get-WmiObject win32_diskdrive).BytesPerSector
512

although WMI was deprecated and new code should use Get-CimInstance instead

PS C:\> (Get-CimInstance win32_diskdrive).BytesPerSector
512

With fsutil beside sectorInfo you can also check the ntfsInfo/refsInfo outputs if the partition is among those file systems

> fsutil fsinfo ntfsinfo C: | findstr /c:"Bytes"
Bytes Per Sector  :                512
Bytes Per Physical Sector :        4096
Bytes Per Cluster :                4096  (4 KB)
Bytes Per FileRecord Segment    :  1024
phuclv
  • 30,396
  • 15
  • 136
  • 260
5

Use fsutil:

fsutil fsinfo sectorInfo D:

Output

LogicalBytesPerSector :                                 4096
PhysicalBytesPerSectorForAtomicity :                    67108864
PhysicalBytesPerSectorForPerformance :                  67108864
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 4096
Device Alignment :                                      Not Aligned (0x1000)
Partition alignment on device :                         Not Aligned (0x100000)
Performs Normal Seeks
Trim Not Supported
Not DAX capable
Not Thinly-Provisioned
hanshenrik
  • 1,925
  • 3
  • 25
  • 38
2

Run the following command:

chkdsk d:

The 3rd output line from bottom up says {XXX bytes in each allocation unit}.

r2d3
  • 4,050