65

如何确定 Windows 7 中的物理扇区大小(例如,如果我有一个具有 4,096 字节扇区而不是传统 512 字节扇区的高级格式驱动器)?

我知道通过单击文件并获取属性,我们可以找到 NTFS Cluster Size,但这与硬盘驱动器的扇区大小不同。

注意:我们询问 Windows 7 是因为它(和 Windows Vista SP1)了解 4096 高级格式硬盘的存在。

4

8 回答 8

78

你想要 fsutil。确保以管理员身份运行命令提示符。

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
于 2012-02-27T13:09:22.577 回答
40

Windows 10 更新:

现在有一个sectorInfo子命令可以提供更好的信息:

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
于 2016-04-26T18:23:16.650 回答
29

我想扩展 Chris Gessler 的回答,并注意没有已知的方法可以使用 Windows Management Instrumentation (WMI) 获取驱动器的物理扇区,例如wmic.

假设我有一个高级格式驱动器(即每个扇区使用 4,096 字节而不是 512 字节):

C:\Windows\system32>fsutil fsinfo ntfsinfo d:
NTFS Volume Serial Number :       0xa016d8a616d87eaa
Version :                         3.1
Number Sectors :                  0x00000000747057ff
Total Clusters :                  0x000000000e8e0aff
Free Clusters  :                  0x000000000e7b2813
Total Reserved :                  0x0000000000000000
Bytes Per Sector  :               512
Bytes Per Physical Sector :       4096

WMI 都不是DiskDrive

wmic:root\cli>diskdrive
Availability  BytesPerSector  Capabilities  CapabilityDescriptions                                       Caption
              512             {3, 4, 10}    {"Random Access", "Supports Writing", "SMART Notification"}  ST1000DM003-9YN162 ATA Device

 

也不Partition

wmic:root\cli>partition get BlockSize, StartingOffset, Name, Index
BlockSize  Index  Name                   StartingOffset
512        0      Disk #0, Partition #0  1048576

可以报​​告底层物理扇区大小当您意识到它们都报告 Windows 正在使用的扇区大小时,这是有道理的。每个扇区 512 字节 - 驱动器恰好在内部不同。

这是因为只有 Windows 8 支持使用4k 扇区。Windows 7 了解驱动器可能是 4k,并努力将其 4k Clusters与硬盘驱动器的底层 4k Sectors对齐。

更新

wmic diskdrive现在确实显示每个扇区的物理字节数Bytes per Sector

C:\Windows\system32>wmic
wmic:root\cli>diskdrive
Availability  BytesPerSector  Capabilities  CapabilityDescriptions                                       
              4096            {3, 4}        {"Random Access", "Supports Writing"}                        

虽然wmic partition仍然是错误的。

视窗 10.0.19041.804

于 2012-11-23T16:54:43.477 回答
15
  1. 在命令行中运行 msinfo32,应该会弹出一个名为“系统信息”的 GUI 窗口
  2. 在左侧窗格中选择“系统摘要->组件->存储->磁盘”。这应该在右窗格中加载所有驱动器的信息
  3. 找到您想要的驱动器并检查“字节/扇区”的值。它应该说“字节/扇区 4096”
于 2015-01-14T17:47:17.183 回答
9

如果你想以编程方式拥有它,你需要从结构发送IOCTL_DISK_GET_DRIVE_GEOMETRY_EX和使用Geometry.BytesPerSectorDISK_GEOMETRY_EX

于 2014-01-13T09:56:22.743 回答
6

您可以从命令行使用wmic :

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

BlockSize是驱动器的扇区大小。

于 2012-02-27T13:18:47.360 回答
5

电源外壳:

$wql = "SELECT Label, Blocksize, Name FROM Win32_Volume WHERE FileSystem='NTFS'"
Get-WmiObject -Query $wql -ComputerName '.' | Select-Object Label, Blocksize, Name

输出示例:

Label            Blocksize Name
-----            --------- ----
OSDisk                4096 C:\
Windows RE Tools      4096 \\?\Volume{b042c778-cd66-4381-9312-3f4311321675}\
PS C:\>
于 2016-07-13T14:55:54.723 回答
1

如果您真的想以编程方式拥有它,则需要将IOCTL_STORAGE_QUERY_PROPERTY提供set发送STORAGE_PROPERTY_QUERY到. 这给出了物理和逻辑扇区大小。PropertyIdStorageAccessAlignmentProperty

注意:这仅适用于 Windows Vista 及更高版本。

于 2018-04-30T13:50:20.030 回答