6
1
Windows can tell me the logical and physical sector size of the drive responsible for a partition/volume via the fsutil fsinfo sectorinfo x:
command (where x
is my drive letter). How can I get this information for a drive that doesn't have any drive letters or volumes of any kind?
I am using Windows 8.1 Pro, but I hope an answer would work for at least Windows 7 as well.
Things I know about but that don't help
wmic partition get BlockSize, Name
is wrong because it only gives the logical sector size and also doesn't work if there are no partitions on the drive.wmic diskdrive get BytesPerSector, Name
again only gives me the logical sector size, but does work on all hard drives. There doesn't appear to be a property ofWin32_DiskDrive
that has the physical size.fsutil fsinfo ntfsinfo \\?\Volume{...}\
only works for drives with partitions, and NTFS partitions at that.- The
sectorinfo
version of the above doesn't work at all with that special volume syntax (Error: The system cannot find the path specified.
). - System Information (
msinfo32
) shows only the logical bytes per sector. - Device Manager does not appear to list anything related to the drive geometry.
I don't want to initialize the drive or create a volume on it because that would blow away the contents that Windows isn't seeing.
I also know about IOCTL_DISK_GET_DRIVE_GEOMETRY_EX
, but using that would require writing and compiling a program. Preferably without third-party tools, how can I find the physical sector size of a hard drive in Windows?
wmic diskdrive get BytesPerSector, Name again only gives me the logical sector size
How did you determine that? This answer to a similar question showswmic diskdrive get BytesPerSector
returning 4096 for a drive in XP, while XP didn't even support 512e (4K physical / 512 logical) as far as I remember. – dxiv – 2016-02-15T02:40:04.533@dxiv Well, it definitely gets the logical bytes per sector on my machine (512):
fsutil fsinfo sectorinfo
says I have 512 logical and 4K physical. Also, it's not the OS that decides the logical. – Ben N – 2016-02-15T03:18:23.657Microsoft support policy for 4K sector hard drives in Windows:
Any large-sector disks, such as 4K native, 512E, or any non-512 native disks, are not supported by Microsoft on any Windows XP-based version of the operating system.
My reading of it is thatwmic
would never misreport a logical sector size as 4K under XP. Which only leaves the possibility for 4K to be the physical sector size in that scenario. Maybe things changed later on. Sorry, I don't have a 4K drive handy to test now. – dxiv – 2016-02-15T03:49:58.663