Managing Disks from the Command Prompt

To use Diskpart, start by running Cmd. exe with elevated privileges . You can do that by opening the Start menu and choosing All Programs, Accessories. On the Accessories submenu, right-click Command Prompt, choose Run As Administrator, and then reply to the User Account Control (UAC) prompt.

For more information about the Command Prompt, see Appendix B, "Working with the Command Prompt"

When you run Diskpart, it opens a console window and dumps you at the DISKPART> prompt. If you type help and press Enter, you see a screen that lists all available commands, like the one shown here:


DiskPart version 6.1.7600



1999-2008 Microsoft Corporation.

On compute





DiskPart version 6.1.7600



Mark the selected partition as active.


Add a mirror to a simple volume.


Assign a drive letter or mount point to the selected volume.


Manipulate volume or disk attributes.


Attaches a virtual disk file.


Enable and disable automatic mounting of basic volunes.


Break a mirror set.



Clear the configuration information, or all infornation, off the



Attempts to reduce the physical size of the file.


Convert between different disk formats.


Create a volume, partition or virtual disk.


Delete an object.


Provide details about an object.


Detaches a virtual disk file.


Exit DiskPart.


Extend a volume.


Expands the maximum size available on a virtual disk.


Display current and supported file systems on tlie volume.


Format the volume or partition.


Assign attributes to the selected GPT partition.


Display a list of commands.



Import a disk group.


Mark the selected partition as inactive.



Display a list of objects.


Merges a child disk with its parents.


Online an object that is currently narked as offline.


Offline an object that is currently marked as online.


Befreshes the state of all disks in the selected pack.

Attempts recovery on disks in the invalid pack, and

resynchronizes mirrored volumes and RAID5 volumes

that have stale plex or parity data.


Does nothing. This is used to comment scripts.


Bemove a drive letter or mount point assignment.


Bepair a RAID—5 volume with a failed member.


Bescan the computer looking for disks and volumes.


Place a retained partition under a simple volume.


Display or set the SAN policy for the currently booted OS.


Shift the focus to an object.


Change the partition type.


Reduce the size of the selected volume.


Displays or sets the GUID partition table <GPT> identifier or

master boot record (MBR) signature of a disk.


Even if you don't prefer the command prompt and don't intend to write disk-management scripts, you should know about Diskpart, because if you ever find yourself needing to manage hard disks from the Windows Recovery Environment (Windows RE), you will have access to Diskpart but not to the Disk Management console. (Windows RE is a special environment that you can use for system-recovery purposes if a major hardware or software

Ln problem prevents you from starting Windows .)

re t

For more information about Windows RE, see "Making Repairs with the Windows Recovery Environment" on page 846.

Windows also includes a second command-line tool for file-system and disk management, called Fsutil. This utility allows you to find files by security identifier (SID), change the short name of a file, and perform other esoteric tasks .


Fsutil and Diskpart are not for the faint of heart or casual experimentation. Both are intended primarily to be incorporated into scripts rather than for interactive use. Diskpart in particular is dense and cryptic, with a complex structure that requires you to list and select objects before you act on them. For more details about Diskpart, see Knowledge Base article 300415, "A Description of the Diskpart Command-Line Utility" ( Although this article dates from Windows XP days and some of the comparisons it makes between Diskpart and the Disk Management console are out of date, its tutorial information about the syntax and usage of Diskpart is still accurate.

Understanding Disk Management Terminology

The current version of Disk Management has simplified somewhat the arcane language of disk administration . Nevertheless, it's still important to have a bit of the vocabulary under your belt. The following terms and concepts are the most important:

• Volume A volume is a disk or subdivision of a disk that is formatted and available for storage. If a volume is assigned a drive letter, it appears as a separate entity in Windows Explorer. A hard disk can have one, several, or many volumes .

• Mounted drive A mounted drive is a volume that is mapped to an empty folder on an NTFS-formatted disk. A mounted drive does not get a drive letter and does not appear separately in Windows Explorer. Instead, it behaves as though it were a subfolder on another volume.

• Format To format a disk is to prepare it for storage using a particular file system (such as NTFS).

NJ un

• File system A file system is a method for organizing folders (directories) and files on a storage medium. Windows 7 supports the following file systems: FAT (File Allocation Table), NTFS (NT File System), CDFS (Compact Disc File System, also sometimes identified as ISO-9660), and UDF (Universal Disk Format) .

• Basic disk and dynamic disk The two principal types of hard-disk organization in Windows are called basic and dynamic:

• A basic disk can be subdivided into as many as four partitions. (Disks that have been initialized using a GUID Partition Table can have more than four.) All volumes on a basic disk must be simple volumes. When you use Disk Management to create new simple volumes, the first three partitions it creates are primary partitions. The fourth is created as an extended partition using all remaining unallocated space on the disk . An extended partition can be organized into as many as 2000 logical disks. In use, a logical disk behaves exactly like a primary partition.

• A dynamic disk offers organizational options not available on a basic disk. In addition to simple volumes, dynamic disks can contain spanned or striped volumes . These last two volume types combine space from multiple disks

• Simple volume A simple volume is a volume contained entirely within a single physical device. On a basic disk, a simple volume is also known as a partition.

• Spanned volume A spanned volume is a volume that combines space from physically separate disks, making the combination appear and function as though it were a single storage medium

• Striped volume A striped volume is a volume in which data is stored in 64-KB strips across physically separate disks to improve performance.

• MBR and GPT disks MBR (master boot record) and GPT (GUID Partition Table) are terms describing alternative methods for maintaining the information regarding a disk's subdivisions . GPT disks support larger volumes (up to 18 exabytes) and more partitions (as many as 128 on a basic disk) . You can convert a disk from MBR to GPT (or vice versa) only before a disk has been partitioned for the first time (or after all partitions have been removed) .

• Active partition, boot partition, and system partition The active partition is the one from which an x86-based computer starts after you power it up . The first physical hard disk attached to the system (Disk 0) must include an active partition . The boot partition is the partition where the Windows system files are located . The system partition is the partition that contains the bootstrap files that Windows uses to start your system and display the boot menu .

V j

Was this article helpful?

0 0
Digital Cancers

Digital Cancers

Get All The Support And Guidance You Need To Be A Success At Protecting Your PC. This Book Is One Of The Most Valuable Resources In The World When It Comes To The Damaging Facts About Computer Viruses.

Get My Free Ebook

Post a comment