Linux – fdisk command in Windows

command linelinuxwindows

In Linux, there is a useful fdisk command.

Is there an analogue for this in Windows? Specifically, I need to use (something like) fdisk -l.

Best Answer

There is diskpart

[start] [run] diskpart list disk

enter image description here

Also, there is wmic diskdrive. You can use that from the command line, but you probably want to apply some filters to avoid ending up with way too much information.

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"}  LSI 9750-8i    DISK SCSI Disk Device                     0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE0                                                    5.08              0                   SCSI                          (Standard disk drives)                              TRUE         Fixed hard disk media                LSI 9750-8i    DISK SCSI Disk Device  \\.\PHYSICALDRIVE0                                         2           SCSI\DISK&VEN_LSI&PROD_9750-8I____DISK\5&15EE98A3&0&000000                                                                   0        0                10        0             19               L2080BGN154FA1000272  -576210269  79987195904    OK                  Win32_ComputerSystem     CORE        36707           224         156224992     8222368      224                
              512             {3, 4}        {"Random Access", "Supports Writing"}  LSI 9750-8i    DISK SCSI Disk Device                     0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE1                                                    5.08              1                   SCSI                          (Standard disk drives)                              TRUE         Fixed hard disk media                LSI 9750-8i    DISK SCSI Disk Device  \\.\PHYSICALDRIVE1                                         2           SCSI\DISK&VEN_LSI&PROD_9750-8I____DISK\5&15EE98A3&0&000100                                                                   0        0                10        1             63               WQC05071864F9000A2CB              2999965248000  OK                  Win32_ComputerSystem     CORE        364725          255         5859307125    93004875     255                
              512             {3, 4}        {"Random Access", "Supports Writing"}  LSI 9750-8i    DISK SCSI Disk Device                     0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE2                                                    5.08              2                   SCSI                          (Standard disk drives)                              TRUE         Fixed hard disk media                LSI 9750-8i    DISK SCSI Disk Device  \\.\PHYSICALDRIVE2                                         1           SCSI\DISK&VEN_LSI&PROD_9750-8I____DISK\5&15EE98A3&0&000200                                                                   0        0                10        2             63               P6901YFP93CC9C000C66  -900772765  144987010560   OK                  Win32_ComputerSystem     CORE        17627           255         283177755     4494885      255                
                                                                                   Generic Flash HS-COMBO USB Device                        0                       FALSE                    Win32_DiskDrive                      Disk drive   \\.\PHYSICALDRIVE3                                                    4.44              3                   USB                           (Standard disk drives)                              TRUE                                              Generic Flash HS-COMBO USB Device     \\.\PHYSICALDRIVE3                                         0           USBSTOR\DISK&VEN_GENERIC&PROD_FLASH_HS-COMBO&REV_4.44\070809103045&1                                                                                                                                                  0                          OK                  Win32_ComputerSystem     CORE