如何在 Windows 7 和 10 上列出有关磁盘的基本信息(磁柱、磁头、扇区、扇区大小)

如何在 Windows 7 和 10 上列出有关磁盘的基本信息(磁柱、磁头、扇区、扇区大小)

在 Linux 上,fdisk 可以毫无问题地提供这些信息。我似乎无法在 Windows 的任何地方执行相同的操作,也无法(乍一看)在旨在接替/替代 fdisk 的 diskpart 中执行相同的操作。

我需要找到 CF 卡的低柱面和高柱面、磁头数量、每条磁道的扇区数以及扇区大小(以字节为单位)。这些都是常见的东西。

我该怎么做?是否有本机界面来获取此信息,还是我必须安装第三方实用程序或启动 Linux liveCD?

答案1

您可以在 Windows 中本地执行此操作,使用Windows 管理规范命令行 (WMIC)接口。在本例中,您需要的命令是wmic diskdrive,它返回Win32_DiskDrive班级。您可以从 CMD 或 PowerShell 执行它。

例如,从我编写本文的系统来看:

PS C:\WINDOWS\system32> wmic diskdrive
Availability  BytesPerSector  Capabilities  CapabilityDescriptions                                       Caption                                 CompressionMethod  ConfigManagerErrorCode  ConfigManagerUserConfig  CreationClassName  DefaultBlockSize  Description  DeviceID            ErrorCleared  ErrorDescription  ErrorMethodology  FirmwareRevision  Index  InstallDate  InterfaceType  LastErrorCode  Manufacturer            MaxBlockSize  MaxMediaSize  MediaLoaded  MediaType                 MinBlockSize  Model                                   Name                NeedsCleaning  NumberOfMediaSupported  Partitions  PNPDeviceID                                                                         PowerManagementCapabilities  PowerManagementSupported  SCSIBus  SCSILogicalUnit  SCSIPort  SCSITargetId  SectorsPerTrack  SerialNumber        Signature   Size           Status  StatusInfo  SystemCreationClassName  SystemName  TotalCylinders  TotalHeads  TotalSectors  TotalTracks  TracksPerCylinder
              512             {3, 4}        {"Random Access", "Supports Writing"}                        Adaptec Array SCSI Disk Device                             0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE0                                                    V1.0              0                   SCSI                          (Standard disk drives)                              TRUE         Fixed hard disk media                   Adaptec Array SCSI Disk Device          \\.\PHYSICALDRIVE0                                         1           SCSI\DISK&VEN_ADAPTEC&PROD_ARRAY\8&9D7B342&0&040000                                                                                        4        0                0         0             63               ########                        3000179105280  OK                  Win32_ComputerSystem     ########    364751          255         5859724815    93011505     255
              512             {3, 4}        {"Random Access", "Supports Writing"}                        Seagate Desktop USB Device                                 0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE6                                                    0130              6                   USB                           (Standard disk drives)                              TRUE         External hard disk media                Seagate Desktop USB Device              \\.\PHYSICALDRIVE6                                         1           USBSTOR\DISK&VEN_SEAGATE&PROD_DESKTOP&REV_0130\########____&0                                                                              0        0                0         0             63               ########            1951563079  2000396321280  OK                  Win32_ComputerSystem     ########    243201          255         3907024065    62016255     255
              512             {3, 4, 10}    {"Random Access", "Supports Writing", "SMART Notification"}  SAMSUNG HD753LJ SCSI Disk Device                           0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE3                                                    1AA0              3                   SCSI                          (Standard disk drives)                              TRUE         Fixed hard disk media                   SAMSUNG HD753LJ SCSI Disk Device        \\.\PHYSICALDRIVE3                                         1           SCSI\DISK&VEN_SAMSUNG&PROD_HD753LJ\4&BE9218C&0&000000                                                                                      0        0                5         0             63               ##############                  750153761280   OK                  Win32_ComputerSystem     ########    91201           255         1465144065    23256255     255
              512             {3, 4, 10}    {"Random Access", "Supports Writing", "SMART Notification"}  INTEL SS DSC2CT120A3 SCSI Disk Device                      0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE1                                                    300i              1                   SCSI                          (Standard disk drives)                              TRUE         Fixed hard disk media                   INTEL SS DSC2CT120A3 SCSI Disk Device   \\.\PHYSICALDRIVE1                                         3           SCSI\DISK&VEN_INTEL_SS&PROD_DSC2CT120A3\4&1EA2D231&0&000000                                                                                0        0                4         0             63               ##################  2085025849  120031027200   OK                  Win32_ComputerSystem     ########    15505           240         234435600     3721200      240
              4096            {3, 4}        {"Random Access", "Supports Writing"}                        WD My Book 1140 USB Device                                 0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE7                                                    1019              7                   USB                           (Standard disk drives)                              TRUE         External hard disk media                WD My Book 1140 USB Device              \\.\PHYSICALDRIVE7                                         1           USBSTOR\DISK&VEN_WD&PROD_MY_BOOK_1140&REV_1019\504C313332314C41473457425348&0                                                              0        0                0         0             63               ##############      3796332454  4000710389760  OK                  Win32_ComputerSystem     ########    60799           255         976735935     15503745     255
              512             {3, 4, 10}    {"Random Access", "Supports Writing", "SMART Notification"}  SAMSUNG HD753LJ SCSI Disk Device                           0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE2                                                    1AA0              2                   SCSI                          (Standard disk drives)                              TRUE         Fixed hard disk media                   SAMSUNG HD753LJ SCSI Disk Device        \\.\PHYSICALDRIVE2                                         1           SCSI\DISK&VEN_SAMSUNG&PROD_HD753LJ\4&1EA2D231&0&010100                                                                                     1        0                4         1             63               ##############                  750153761280   OK                  Win32_ComputerSystem     ########    91201           255         1465144065    23256255     255
              4096            {3, 4}        {"Random Access", "Supports Writing"}                        WD My Book 1140 USB Device                                 0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE8                                                    1016              8                   USB                           (Standard disk drives)                              TRUE         External hard disk media                WD My Book 1140 USB Device              \\.\PHYSICALDRIVE8                                         1           USBSTOR\DISK&VEN_WD&PROD_MY_BOOK_1140&REV_1016\504C313332314C41473347365348&0                                                              0        0                0         0             63               ##############      3679187067  4000710389760  OK                  Win32_ComputerSystem     ########    60799           255         976735935     15503745     255
              512             {3, 4}        {"Random Access", "Supports Writing"}                        WD 10EACS External USB Device                              0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE5                                                    1.65              5                   USB                           (Standard disk drives)                              TRUE         External hard disk media                WD 10EACS External USB Device           \\.\PHYSICALDRIVE5                                         0           USBSTOR\DISK&VEN_WD&PROD_10EACS_EXTERNAL&REV_1.65\57442D574341553430373030383036&0                                                         0        0                0         0             63               ###############     0           1000202273280  OK                  Win32_ComputerSystem     ########    121601          255         1953520065    31008255     255
              512             {3, 4, 10}    {"Random Access", "Supports Writing", "SMART Notification"}  Crucial_ CT512MX100SS SCSI Disk Device                     0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE4                                                    MU01              4                   SCSI                          (Standard disk drives)                              TRUE         Fixed hard disk media                   Crucial_ CT512MX100SS SCSI Disk Device  \\.\PHYSICALDRIVE4                                         1           SCSI\DISK&VEN_CRUCIAL_&PROD_CT512MX100SS\4&BE9218C&0&010100                                                                                1        0                5         1             63               ############                    512105932800   OK                  Win32_ComputerSystem     ########    62260           255         1000206900    15876300     255

(我用 删除了序列号和系统名称########。)

您可能已经注意到,这一行的长度相当长,因此您需要选择性地返回属性,让其每行输出一个属性(wmic diskdrive list /format:list),将输出通过管道传输到文件,和/或在运行命令之前将控制台宽度设置为非常大,因为如果启用换行,它将基本上难以辨认。

答案2

我建议gwmi win32_diskdrive |select *使用 powershell。如果您只需要圆柱体等,则不要select *使用 select DeviceID,SectorsPerTrack,Size,TotalCylinders,TotalHeads,TotalSectors,TotalTracks,TracksPerCylinder,Partitions,BytesPerSector

你得到的输出将如下:

DeviceID          : \\.\PHYSICALDRIVE0
SectorsPerTrack   : 63
Size              : 256052966400
TotalCylinders    : 31130
TotalHeads        : 255
TotalSectors      : 500103450
TotalTracks       : 7938150
TracksPerCylinder : 255
Partitions        : 3
BytesPerSector    : 512

相关内容