Installing and Managing Hard Disk Drives

 < Day Day Up > 



A key reason for using DiskPart is to help you to configure and maintain hard disk drives. Key management tasks include checking for new drives, determining drive status, and managing partition table styles.

Installing and Checking for a New Drive

Windows operating systems support both hot swappable and non-hot swappable drives. Hot swapping is a feature that allows you to remove devices without shutting off the computer. In most cases, hot swappable drives are installed and removed from the front of the computer, and if a computer supports hot swapping, you can install drives to the computer without having to shut down. After you hot-swap drives, start DiskPart, then type rescan to find the new drives. New drives that are found are added as basic disks. If a drive that you’ve added isn’t found, reboot the computer.

If the computer doesn’t support the hot swapping of drives, you must turn the computer off and then install the new drives. Afterward you can scan for new drives as previously described, if necessary.

Checking Drive Status and Configuration

You can use DiskPart to check the status of drives by typing list disk from the DiskPart prompt. Typical output from list disk looks like this:

Disk ##      Status        Size       Free       Dyn    Gpt
-------- ---------- ------- ------- --- ---
Disk 0 Online 56 GB 0 B
Disk 1 Online 29 GB 0 B
Disk 2 Offline 37 GB 31 GB

As you can see, list disk shows each configured disk on the system by

  • Disk ### The number of the disk.

  • Status The current status of the disk.

  • Size The total capacity of the disk.

  • Free The available space for partitioning, not the amount of actual free space on the disk.

  • Dyn Indicates the disk type is dynamic if there is an asterisk in this column. Otherwise, the disk is the basic disk type.

  • Gpt Indicates the disk partition table type is GUID Partition Table (GPT) if there is an asterisk in this column. Otherwise, the partition type is Master Boot Record (MBR).

In the previous example, the computer had three basic disks that used the MBR partition type. Although disks 0 and 1 were online, disk 2 was offline and could be brought online by changing the focus to disk 2 (by typing select disk 2) and then typing online.

As you can see, knowing the drive status is useful when you install new drives but also when you want to troubleshoot drive problems. Table 8-2 summarizes the most common status values.

Table 8-2: Common Drive Status Values and Their Meaning

Status

Description

Resolution

Audio CD

An audio CD is in the CD/DVD drive.

The drive doesn’t have any known problems.

Foreign

The dynamic disk has been moved to your computer but hasn’t been imported for use. A failed drive brought back online might sometimes be listed as Foreign.

Use the IMPORT command to add the disk to the system.

Initializing

A temporary status that occurs when you convert a basic disk to a dynamic disk.

When initialization is complete, the status should change to Online automatically.

Missing

The dynamic disk is corrupted, turned off, or disconnected. This value appears as the disk name instead of in the Status column.

Reconnect or turn on the missing disk, and then use RESCAN to locate the volume. If the disk won’t be used again, use DELETE DISK to delete the disk from the disk list.

No Media

No media have been inserted into the CD-ROM or removable drive. Only CD-ROM and removable disk types display this status.

Insert a CD-ROM, floppy disk, or removable disk to bring the disk online.

Not Initialized

The disk does not contain a valid signature. Windows writes the MBR or GPT for the disk the first time you start Disk Management using a wizard that shows the new disks detected. If you cancel the wizard before the disk signature is written, this status occurs.

If you haven’t started Disk Management yet, do so, and then use the Initialize Disk Wizard to write the disk signature. Otherwise, right-click the disk in Disk Management and then select Initialize Disk.

Offline

The dynamic disk isn’t accessible and might be corrupted or temporarily unavailable. If the disk name changes to Missing, the disk can no longer be located or identified on the system.

Check for problems with the drive, its controller, and cables. Make sure that the drive has power and is connected properly. Use the ONLINE command to bring the disk back online (if possible).

Online

The normal disk status. It means the disk is accessible and doesn’t have problems. Both dynamic disks and basic disks display this status.

The drive doesn’t have any known problems.

Online (Errors)

Input/output (I/O) errors have been detected on a dynamic disk.

You can try to correct temporary errors using the ONLINE command. This command will also resynchronize mirrored and RAID-5 volumes.

Unreadable

The disk isn’t currently accessible, which can occur when rescanning disks. Both dynamic and basic disks display this status.

If the drives aren’t being scanned, the drive might be corrupt or have I/O errors. Use the RESCAN command to correct the problem (if possible). You might also want to reboot the system.

Unrecognized

The disk is of an unknown type and can’t be used on the system. A drive from a non-Windows system might display this status.

You can’t use the drive on the computer. Try a different drive.

Changing Drive Partition Styles

After you install a drive on a computer, you’ll need to configure it for use. You configure the drive by partitioning it and creating file systems in the partitions, as needed. Two partition styles are used for disks: Master Boot Record (MBR) and GUID Partition Table (GPT).

MBR and GPT Partition Styles

X86-based computers use the MBR partition style. MBR contains a partition table that describes where the partitions are located on the disk. With this partition style, the first sector on a hard disk contains the master boot record and a binary code file called the master boot code that’s used to boot the system. This sector is unpartitioned and hidden from view to protect the system.

With the MBR partitioning style, disks support volumes of up to 4 terabytes (TB) and use one of two types of partitions:

  • Primary

  • Extended

Each MBR drive can have up to four primary partitions or three primary partitions and one extended partition. Primary partitions are drive sections that you can access directly for file storage. You make a primary partition accessible to users by creating a file system on it. Unlike primary partitions, you can’t access extended partitions directly. Instead, you can configure extended partitions with one or more logical drives that are used to store files. Being able to apportion extended partitions into logical drives allows you to apportion a physical drive into more than four sections.

Itanium-based computers running 64-bit versions of Windows use the GPT partition style. A GPT-based disk has two required partitions and one or more optional (OEM or data) partitions:

  • EFI system partition (ESP)

  • Microsoft Reserved partition (MSR)

  • At least one data partition

Additionally, GPT disks support volumes of up to 18 exabytes (EB) and as many as 128 partitions. Although there are underlying differences between the GPT and MBR partitioning styles, most disk-related tasks are performed in the same way.

Converting Partition Table Styles

Using the CONVERT command, DiskPart can help you change partition table styles from MSR to GPT or from GPT to MSR. Changing partition table styles is useful when you

  • Move disks between X86-based computers and IA64-based computers

  • Receive new disks that are formatted for the wrong partition table style

You can only convert partition table styles on empty disks, however. This means the disks must either be new or newly formatted. You can, of course, empty the disk by removing any existing partitions or volumes on the disk that you want to convert.

Note

DiskPart provides the CLEAN command for wiping out all the volume or partition information on a disk. When you give a disk focus and then use the CLEAN command, all partition or volume information on the disk is removed. On MBR disks, this means that the MBR partition and hidden sector information are overwritten. On GPT disks, the GPT partition information, including the protected MBR, is overwritten. You can also use CLEAN ALL to specify that each and every sector on the disk should be set to zero.

Caution

If you haven’t backed up the data on the drives you want to convert, don’t delete any partitions or volumes. Doing so will clear all data on the disk.

The procedure you use to convert the partition table style is as follows:

  1. Invoke DiskPart by typing diskpart at the command prompt.

  2. Select the disk to work with to give it focus, such as

    DISKPART> select disk 2

  3. Convert the disk, as follows:

    • To convert a disk from MBR to GPT, type convert gpt at the command prompt.

    • To convert a disk from GPT to MBR, type convert mbr at the command prompt.



 < Day Day Up > 



Microsoft Windows Command-Line Administrator's Pocket Consultant
MicrosoftВ® WindowsВ® Command-Line Administrators Pocket Consultant
ISBN: 0735620385
EAN: 2147483647
Year: 2004
Pages: 114

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net