One way to see how disks are
partitioned on a Microsoft Windws system is to
view the information using Disk Management. You can start the
utility from a command prompt with
administrator privileges by typing diskmgmt.msc
. That will provide
a graphical display of the partitions on the drives in the system and
externally attached to the system.
In the example above, there are 3 hard disk drives. Two of those are internal disk drives partitioned identically and the third is an external USB drive, though the Disk Management display doesn't indicate the third drive is externally attached.
Another method is to use the diskpart
command, which can be run
from a command prompt - obtain a command prompt with administrator privileges.
You can obtain help on using the utility by typing help
at the
DISKPART prompt.
C:\>diskpart Microsoft DiskPart version 5.2.3790.3959 Copyright (C) 1999-2001 Microsoft Corporation. On computer: ANDY DISKPART> help Microsoft DiskPart version 5.2.3790.3959 ADD - Add a mirror to a simple volume. ACTIVE - Marks the current basic partition as active. ASSIGN - Assign a drive letter or mount point to the selected volume. AUTOMOUNT - Enables and disables automatic mounting of basic volumes. BREAK - Break a mirror set. CLEAN - Clear the configuration information, or all information, off the disk. CONVERT - Converts between different disk formats. CREATE - Create a volume or partition. DELETE - Delete an object. DETAIL - Provide details about an object. ATTRIBUTES - Manipulate volume attributes. EXIT - Exit DiskPart EXTEND - Extend a volume. GPT - Assigns attributes to the selected GPT partition. HELP - Prints a list of commands. IMPORT - Imports a disk group. INACTIVE - Marks the current basic partition as inactive. LIST - Prints out a list of objects. ONLINE - Online a disk that is currently marked as offline. REM - Does nothing. Used to comment scripts. REMOVE - Remove a drive letter or mount point assignment. REPAIR - Repairs a RAID-5 volume with a failed member. RESCAN - Rescan the computer looking for disks and volumes. RETAIN - Place a retained partition under a simple volume. SELECT - Move the focus to an object. DISKPART>
You can see what options are available for a diskpart command by typing the command followed by a question mark as shown below:
DISKPART> list ? Microsoft DiskPart version 5.2.3790.3959 DISK - Prints out a list of disks. PARTITION - Prints out a list of partitions on the current disk. VOLUME - Prints out a list volumes. DISKPART>
You can use the command list disk
to see the disk drives
internally or externally attached to the system.
DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ---------- ------- ------- --- --- Disk 0 Online 466 GB 0 B Disk 1 Online 466 GB 0 B Disk 2 Online 1863 GB 2015 KB * DISKPART>
To see partition information, you can select one of the drives using
select disk number
, where number is the number shown
for the drive in the list disk
output, and then issue a list
partition
command.
DISKPART> select disk 0 Disk 0 is now the selected disk. DISKPART> list partition Partition ### Type Size Offset ------------- ---------------- ------- ------- Partition 1 Primary 98 GB 32 KB Partition 2 Extended 349 GB 98 GB Partition 3 Logical 349 GB 98 GB Partition 4 Primary 19 GB 447 GB DISKPART> select disk 2 Disk 2 is now the selected disk. DISKPART> list partition Partition ### Type Size Offset ------------- ---------------- ------- ------- Partition 1 Primary 1863 GB 1024 KB DISKPART>
You can return to the command prompt by typing exit
at the
DISKPART prompt.
You can also obtain information on disk drives using a WMIC command as shown below:
C:\>wmic diskdrive get manufacturer, model, partitions Manufacturer Model Partitions (Standard disk drives) WDC WD5000AAKB-00H8A0 3 (Standard disk drives) WDC WD5000AAKB-00H8A0 3 (Standard disk drives) WD My Passport 25E2 USB Device 1 C:\>
The above output shows that the first two drives are the same model of drive from Western Digital and each have 3 partitions while the third drive is also from Western Digital, but is an external USB "My Passport" drive.
Other options for using wmic to query drive information can be obtained by
typing wmic diskdrive get /?
at a command prompt.
C:\>wmic diskdrive get /? Property get operations. USAGE: GET [<property list>] [<get switches>] NOTE: <property list> ::= <property name> | <property name>, <property list> The following properties are available: Property Type Operation ======== ==== ========= Availability N/A N/A BytesPerSector N/A N/A Capabilities N/A N/A CapabilityDescriptions N/A N/A CompressionMethod N/A N/A ConfigManagerErrorCode N/A N/A ConfigManagerUserConfig N/A N/A DefaultBlockSize N/A N/A Description N/A N/A DeviceID N/A N/A ErrorCleared N/A N/A ErrorDescription N/A N/A ErrorMethodology N/A N/A Index N/A N/A InstallDate N/A N/A InterfaceType N/A N/A LastErrorCode N/A N/A Manufacturer N/A N/A MaxBlockSize N/A N/A MaxMediaSize N/A N/A MediaLoaded N/A N/A MediaType N/A N/A MinBlockSize N/A N/A Model N/A N/A Name N/A N/A NeedsCleaning N/A N/A NumberOfMediaSupported N/A N/A PNPDeviceID N/A N/A Partitions N/A N/A PowerManagementCapabilities N/A N/A PowerManagementSupported N/A N/A SCSIBus N/A N/A SCSILogicalUnit N/A N/A SCSIPort N/A N/A SCSITargetId N/A N/A SectorsPerTrack N/A N/A Signature N/A N/A Size N/A N/A Status N/A N/A StatusInfo N/A N/A SystemName N/A N/A TotalCylinders N/A N/A TotalHeads N/A N/A TotalSectors N/A N/A TotalTracks N/A N/A TracksPerCylinder N/A N/A The following GET switches are available: /VALUE - Return value. /ALL(default) - Return the data and metadata for the attribute. /TRANSLATE:<table name> - Translate output via values from <table name>. /EVERY:<interval> [/REPEAT:<repeat count>] - Returns value every (X interval) se conds, If /REPEAT specified the command is executed <repeat count> times. /FORMAT:<format specifier> - Keyword/XSL filename to process the XML results. NOTE: Order of /TRANSLATE and /FORMAT switches influences the appearance of outp ut. Case1: If /TRANSLATE precedes /FORMAT, then translation of results will be follo wed by formatting. Case2: If /TRANSLATE succeeds /FORMAT, then translation of the formatted results will be done. C:\>
References:
Related articles: