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:

Microsoft

DiskPart version 6.1.7600

Copyright

<C>

1999-2008 Microsoft Corporation.

On compute

ir: BRONCOII

DISKPART>

help

Microsoft

DiskPart version 6.1.7600

ACTIUE

_

Mark the selected partition as active.

ADD

Add a mirror to a simple volume.

ASSIGN

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

ATTRIBUTES

Manipulate volume or disk attributes.

ATTACH

Attaches a virtual disk file.

AUIOMOUNT

Enable and disable automatic mounting of basic volunes.

BREAK

Break a mirror set.

CLEAN

-

Clear the configuration information, or all infornation, off the

COMPACT

_

Attempts to reduce the physical size of the file.

CONUERT

Convert between different disk formats.

CREATE

Create a volume, partition or virtual disk.

DELETE

Delete an object.

DETAIL

Provide details about an object.

DETACH

Detaches a virtual disk file.

EXIT

Exit DiskPart.

EXTEND

Extend a volume.

EXPAND

Expands the maximum size available on a virtual disk.

FILESVSTEMS -

Display current and supported file systems on tlie volume.

FORMAT

Format the volume or partition.

GPT

Assign attributes to the selected GPT partition.

HELP

Display a list of commands.

IMPORT

-

Import a disk group.

INACTIUE

Mark the selected partition as inactive.

LIST

-

Display a list of objects.

MERGE

Merges a child disk with its parents.

ONLINE

Online an object that is currently narked as offline.

OFFLINE

Offline an object that is currently marked as online.

RECOUER

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.

REM

Does nothing. This is used to comment scripts.

REMOVE

Bemove a drive letter or mount point assignment.

REPAIR

Bepair a RAID—5 volume with a failed member.

RESCAN

Bescan the computer looking for disks and volumes.

RETAIN

Place a retained partition under a simple volume.

SAN

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

SELECT

Shift the focus to an object.

SETID

Change the partition type.

SHRINK

Reduce the size of the selected volume.

UNIQUEID

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

master boot record (MBR) signature of a disk.

DISKPART>

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 .

caution

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" (w7io.com/2501). 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