How can I determine the sector size in windows?

后端 未结 8 557
时光取名叫无心
时光取名叫无心 2020-12-22 23:01

How can I determine the Physical Sector Size (e.g. if i have an Advanced Format drive with 4,096 byte sectors rather than the legacy 512 byte sectors) in Wi

相关标签:
8条回答
  • 2020-12-22 23:31

    If you want to have it programmatically, you need to send IOCTL_DISK_GET_DRIVE_GEOMETRY_EX and use Geometry.BytesPerSector from DISK_GEOMETRY_EX structure

    0 讨论(0)
  • 2020-12-22 23:33

    If you really want to have it programmatically, you need to send IOCTL_STORAGE_QUERY_PROPERTY providing STORAGE_PROPERTY_QUERY with PropertyId set to StorageAccessAlignmentProperty. This gives both physical and logical sector sizes.

    Note: this only works on Windows Vista and higher.

    0 讨论(0)
  • 2020-12-22 23:37

    Windows 10 update:

    There is now a sectorInfo sub-command which may provide better information:

    C:\>fsutil fsinfo sectorInfo C:
    
    LogicalBytesPerSector :                                 512
    PhysicalBytesPerSectorForAtomicity :                    4096
    PhysicalBytesPerSectorForPerformance :                  4096
    FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 4096
    Device Alignment :                                      Aligned (0x000)
    Partition alignment on device :                         Aligned (0x000)
    Performs Normal Seeks
    Trim Not Supported
    
    0 讨论(0)
  • 2020-12-22 23:39
    1. Run msinfo32 in command line that should popup a GUI window called "System Information"
    2. In the left pane select "System Summary->Components->Storage->Disks". This should load info of all drives in the right pane
    3. Find your desired drive and check the value for "Bytes/Sector". it should say "Bytes/Sector 4096"
    0 讨论(0)
  • 2020-12-22 23:43

    You can use wmic from the command line:

    C:\Windows\System32\wmic partition get BlockSize, StartingOffset, Name, Index
    
    BlockSize  Index  Name                   StartingOffset
    512        0      Disk #0, Partition #0  32256
    512        1      Disk #0, Partition #1  370195176960
    

    The BlockSize is the sector size of the drive.

    0 讨论(0)
  • 2020-12-22 23:50

    You want fsutil. Make sure you run Command Prompt as Admin.

    C:\Windows\system32>fsutil fsinfo ntfsinfo c:
    NTFS Volume Serial Number :       0xf4ca5d7cca5d3c54
    Version :                         3.1
    Number Sectors :                  0x00000000378fd7ff
    Total Clusters :                  0x0000000006f1faff
    Free Clusters  :                  0x00000000000e8821
    Total Reserved :                  0x0000000000000910
    Bytes Per Sector  :               512
    Bytes Per Physical Sector :       512
    Bytes Per Cluster :               4096
    Bytes Per FileRecord Segment    : 1024
    Clusters Per FileRecord Segment : 0
    Mft Valid Data Length :           0x00000000196c0000
    Mft Start Lcn  :                  0x00000000000c0000
    Mft2 Start Lcn :                  0x000000000097ffff
    Mft Zone Start :                  0x000000000051f920
    Mft Zone End   :                  0x000000000051f9a0
    RM Identifier:        0652C3D3-7AA9-11DA-ACAC-C80AA9F2FF32
    
    0 讨论(0)
提交回复
热议问题