List all drives command line: on Windows

There are different commands available to view list of drive on Windows but you need administrator privileges

  • wmic
  • fsutil
  • diskpart
  • Using PowerShell

Storage is organised as Disks, Partitions, Volumes and Virtual Disks, Where

  • Disk is the physical storage device either HDD or SSD attached to the computer
  • Partition is the region or logical section on the secondary storage that is managed separately
  • A volume is the storage container on a file system. Comparing volume with partition, volume is single accessible storage area with a single file system while a partition is logical subdivision of a storage (HDD)
  • Virtual hard disks (VHDs) are virtual hard disk files that are mounted, and operated much identical to physical hard drives but differences is that they are typically used by Hyper-V virtual machines.

This article provides different set of commands that can be used to list Disks, partitions, and Volumes on Windows

Open the powershell or command prompt with admin privileges

Using Wmic Command

type the following

wmic 
diskdrive get 

List the volume drive letters using wmic

wmic logicaldisk get name 

get verbose output using wmic command with command line arguments as follows

wmic logicaldisk get deviceid, volumename, description

or,

wmic logicaldisk get caption 

Using FsUtil

List drive information using “fsutil”

fsutil fsinfo drives 

Using Diskpart Command

Or, we can use the diskpart

Open the command prompt or power shell with admin privileges, then go ahead with following commands

diskpart 

To list the disks

list disk 

To list volumes

list volume 

List the partition, but you need to select the one of the disk using disk number

list disk using command “list disk”


DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Errors          931 GB  2048 KB   *    *
  Disk 1    Online          476 GB  2048 KB        *

 

For suppose select the disk 0 and list partitions

DISKPART> select disk 0

Disk 0 is now the selected disk.

DISKPART> list partition

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Dynamic Reserved  1024 KB  1024 KB
  Partition 2    Reserved           127 MB  2048 KB
  Partition 3    Dynamic Data       931 GB   129 MB

make sure appropriate disk is selected to check partitions on selected disk using command “list partition” .

List Drives using PowerShell

Use the following command to list drives using Windows PowerShell

List the drives using “PowerShell” using “get-psdrive” command

get-psdrive -psprovider filesystem 

get-volume command on PowerShell gives the output of volumes on computer

get-volume 

Command mountvol

Command mountvol can be used to create, delete or list a volume mount points

List drives and mount points using command mountvol

mountvol 
Default image
neotam
Naveen T aka neotam. Programming language agnostic, Software architect, Python expert, Networking & DevOps engineer & consultant with 7+ years of experience in creating serious web applications, real time event-driven non blocking applications and database driven applications ranging from small scale to enterprise grade. website
Leave a Reply