Section 2.2. Managing and Maintaining Physical and Logical Devices


2.2. Managing and Maintaining Physical and Logical Devices

Server systems have both physical and logical devices. Physical devices include all hardware devices connected to or configured within the server system, and include sound cards, video cards, memory, system bus, disk controllers, and physical disks. Logical devices are used to abstract the physical components of hardware devices and represent them in a way that is more manageable. The primary logical devices you'll work with are logical volumes, which are the basic unit of disk storage that you can configure and manage.

2.2.1. Installing and Configuring Server Hardware Devices

Hardware devices installed on a computer communicate with Windows Server 2003 using software device drivers. For a hardware device driver to work properly, the appropriate device driver variant must be installed, the resource settings for the device must be configured appropriately, and the device properties must be set correctly. In most cases, hardware manufacturers will provide a device driver for the hardware device. Windows Server 2003 includes an extensive library of device drivers.

2.2.1.1. Understanding Plug-and-Play and Non-Plug-and-Play devices

Two basic types of hardware drivers are used on Windows systems:

  • Plug-and-Play (PnP)

  • Non-Plug-and-Play (Non-PnP)

Most Windows-compatible devices support PnP. PnP allows Windows to detect and install a hardware device automatically either from the library of device drivers maintained by Windows or from a manufacturer-supplied device driver. If a device is detected and there is no device driver, Windows will prompt you to specify the location of the device driver.

In most cases, non-PnP devices are not detected automatically after installation and must be manually installed using the Add Hardware Wizard, which is accessible in the Control Panel and from the Hardware tab of the System utility.

2.2.1.2. Understanding signed and unsigned drivers

On Windows 2000 and later computers, all hardware device drivers are either signed or unsigned. If a device driver is signed, then the driver has a digital signature. The digital signature means that a driver has been authenticated by the digital signer, which typically is Microsoft Windows Publisher, and has not been altered or overwritten by other installation programs or by virus programs. If a device driver is signed by Microsoft Windows Publisher, then the device driver was included with the operating system. If a device driver is signed by Microsoft Windows Hardware Compatibility Publisher, it means the device driver has been tested in the Windows Hardware Quality Labs (WHQL) (and was probably released after the release of the operating system).


Tip: Generally speaking, you should always use a signed driver if one is available for the hardware device. Before you install hardware using an unsigned (and potentially dangerous) driver, you should test the driver on a similarly configured computer in a development or test environment.

By default, Windows Server 2003 warns you if you try to install an unsigned device driver. Windows can also be configured to allow all device drivers to be installed or prevent unsigned device drivers from being installed. These settings can be made for individual computers using Control Panel, and for all computers in a domain, site, or organizational unit (OU) through Group Policy. Group Policy can also be used to prohibit users from changing driver installation settings.

As long as you are not prohibited from doing so, you can change driver settings for individual computers by clicking the Driver Signing button on the Hardware tab of the System utility. This displays the Driver Signing Options dialog box. In this dialog box, you can choose the action you want Windows to take whenever someone tries to install an unsigned device driver. As Figure 2-1 shows, the options are:

Figure 2-1. Settings in the Driver Signing Options dialog box can be used to change the way Windows handles unsigned drivers.



Ignore

Allows all device drivers to be installed without having to see and respond to a warning prompt.


Warn

Prompts with a warning message prior to installing a hardware device with an unsigned driver. The user can then continue or cancel the installation (the default).


Block

Prevents installing unsigned drivers. Windows will not install any unsigned device driver and will not display a warning prompt.


Make This Action The System Default

Select this checkbox to make this the default for all users. Clear this option to apply these options only to the current user.


Tip: Windows Server 2003 will not install drivers with known problems. If you try to install a driver with known problems, the Windows Driver Protection facility will block the installation.
2.2.1.3. Installing hardware devices

Administrators can install any hardware device and its drivers, including both PnP and non-PnP devices. Users can only install PnP devices that are detected and installed automatically using signed drivers stored in Windows device driver library. If the device requires the operating system to prompt for any reason, including to specify manufacturer supplied drivers or designate configuration options, users will not be able to complete the installation. The only exception is for users who have been designated specific permission to install such devices.


Tip: For the exam, you'll definitely want to have a strong understanding of how device installation works for both administrators and users.

If a device isn't automatically installed and you have a manufacturer's installation disk, you should install the device using the disk. If this doesn't work or an installation disk isn't available, you can install it using the Add Hardware Wizard by following through these steps:

  1. Open Add Hardware in Control Panel. When the wizards starts, it scans the computer for PnP devices and installs drivers for any that are found.

  2. If no devices are found in Step 1, continue with the manual installation by clicking Next. Then select Yes, I Have Already Connected The Hardware, and then click Next.

  3. The wizard then displays a list of all installed devices. If you select one of these devices and click Next, the wizard will quit. If you scroll down to the bottom of the installed hardware list and select Add A New Hardware Device and then click Next, you'll be able to continue with the installation.

  4. Next, you can choose whether to search for and install the new hardware device, or have it presented in a list from which you can manually select a driver. If you don't already have a driver, select the search option. If you do have a driver, select the install option, and then click Next.

  5. If the wizard searches and fails, or if you elect to install the hardware, you can select the hardware category of the device you are trying to install or simply accept the default to show all devices. Click Next.

  6. If you have the drivers for the device, click Have Disk to specify the location of the drivers on your hard disk, floppy, or CD. Otherwise, choose the device manufacturer and device model to use a driver already available in Windows. If the device model isn't listed, the driver isn't included with the operating system.

  7. Follow the remaining prompts to complete the installation. In some cases, you might be prompted to restart the computer as well.

2.2.1.4. Using Device Manager

All detected devices are listed in the Device Manager snap-in, which is installed by default in the Device Manager console (devmgmt.msc) and in the Computer Management console (compmgmt.msc) (see Figure 2-2). Devices that have been detected but are not installed or properly configured are shown with a yellow warning icon. Devices that have been disabled have a red warning icon.

Figure 2-2. Device Manager is used to view and manage installed hardware devices.


Device Manager can be used to manage devices on local computers only. On remote computers, Device Manager has Read Only access. You can use Device Manager anytime you have a question as to whether hardware devices on a computer are working properly. Common tasks include:


Viewing hardware device status

Using options of the View menu, you can view devices by type or by connection. A yellow warning icon indicates improper installation or configuration, and, as such, can indicate that a device is detected but not installed or that a device has a resource conflict with another device.


Scanning for hardware changes

If you've made hardware configuration changes that aren't shown in Device Manager, you can select Action Scan For Hardware Changes.


Changing hardware configuration settings

Right-click the device and select Properties. You can then view the properties and settings for the device. If the device allows manual configuration through Windows, you'll be able to change resource usage on the Resources tab.


Printing summaries of installed devices

Select Action Print. In the Print dialog box, you can then select the report type as "System summary," "Selected class or device," or "All devices and system summary." Similar reports can be obtained from the command line using Driverquery. Type Driverquery /? for details.

2.2.1.5. Configuring hardware devices

In Device Manager, you can view and configure hardware devices by right-clicking a device and selecting Properties. Most devices have a dialog box with General, Driver, Details, and Resources tabs. Depending on device type, some devices have fewer or additional tabs.

Figure 2-3 shows the three most common tabs you'll refer to when working with devices:

Figure 2-3. The General, Driver, and Resource tabs.



General

The General tab provides basic details on the device type, manufacturer, and installation location. It also lists the device status and provides a Troubleshoot button for troubleshooting device issues. Clicking Troubleshoot starts the Hardware Troubleshooter in the Help and Support Center. You can also enable or disable a device from the General tab.


Driver

The Driver tab lists the driver provider, date, version, and digital signer (if any). Clicking the Driver Details button shows the files associated with the driver as well as the standard driver details. Clicking the Update Driver buttons allows you to specify a new or updated driver for the device using a process that is similar to the manual driver installation process described previously in "Installing hardware devices." If a driver update fails or the updated driver proves to be faulty, you can go back to the previously installed driver by clicking Roll Back Driver. Drivers can be uninstalled by clicking Uninstall. An uninstalled PnP device is removed from Device Manager. An uninstalled non-PnP device is listed in Device Manager but not configured with a driver.


Resources

The Resources tab shows the resources being used by the device and lists whether there are any conflicts for in-use resources with other devices. If a device can be manually configured through Windows, you'll be able to clear Use Automatic Settings and then click Change Setting to define new resource settings. Typically, you won't need to manually configure device resource assignment. If you manually assign resources, both the device and the resource will be unavailable for automatic configuration.

2.2.1.6. Troubleshooting hardware devices

Windows Server 2003 has fewer problems with hardware devices than previous versions of the operating system. That said, if something goes wrong with a device, it will more typically be a non-PnP device than a PnP device. You may also experience problems with a device after updating its drivers.

In Device Manager, the device is listed with a yellow warning icon if there is a problem with its configuration or it has been detected but there is no driver installed. If you've recently updated the driver for the device, you can try rolling back to the previous version to correct the problem. To do this, open Device Manager and access the device's properties dialog box. On the Driver tab, click Rollback Driver to start the rollback process and follow the prompts.

Other device problems can be resolved using the Hardware Update Wizard or the Hardware Troubleshooter. To start the Hardware Update Wizard, follow these steps:

  1. Open Add Hardware in Control Panel. Click Next, select Yes, I Have Already Connected The Hardware, and then click Next again.

  2. Select the hardware device you are having trouble with, as shown in Figure 2-4, and then click Next.

  3. Click Finish to start the Hardware Update Wizard and then follow the instructions.

Figure 2-4. Begin troubleshooting with the Add Hardware Wizard.


For a device whose drivers are not installed, you can start the Hardware Update Wizard from Device Manager as well. In Device Manager, right-click the device and then select Properties. On the General tab, click Reinstall Driver to start the Hardware Update Wizard. If a device driver is installed, the General tab of the driver properties dialog box will have a Troubleshoot button instead of a Reinstall Driver button. Clicking the Troubleshoot button starts the Hardware Troubleshooter, which offers a series of prompts with questions and answers that can be used to troubleshoot.


Tip: If the driver has been provided by Windows Update, you don't need administrator rights on the local machine to install the driver.

Faulty drivers can also cause the operating system to crash or fail to start. Use the following technique to resolve the problem:

  • If you had to restart the operating system after installing a driver and the operating system fails to start, press F8 as the system starts and then specify that you want to use the Last Known Good Configuration as the boot option. Selecting this startup option restores the registry key HKLM\System\CurrentControlSet with the previous driver information.

  • If you had to restart the operating system after installing a driver and you successfully log on before a problem occurs, which could happen with an updated video driver, you will not be able to use the Last Known Good Configuration. The Last Known Good Configuration is overwritten when you successfully log on. In this case, you may need to start the computer in Safe Mode. When the computer is starting, press F8, and then choose Safe Mode as the boot option. After you log on, use Device Manager to correct the device problem by rolling back to the previous driver or disabling the device.

  • If both the Last Known Good Configuration and Safe Mode do not work, you can attempt to recover the system using the Recovery Console. If Recovery Console is not available as a boot option when you press F8, it has not been installed and must be started from the operating system CD. Find it in the Windows Server 2003 CD, and then restart the system. When Setup starts, follow the onscreen instructions and then press R to choose Repair Or Recover. Next, press C to start the Recovery Console. After you provide the local computer administrator password, you'll see a command prompt. Type help to get a list of available commands. When you are finished, type exit to exit the console and restart the computer.

2.2.2. Managing Basic and Dynamic Disks

Physical disk drives are a type of hardware device that can be installed or attached to a computer. Although hot swappable disk drives can be installed or attached without powering down a computer, most other types of drives require that you power down a computer prior to installing or attaching the drive. Windows should automatically detect any drive you install or attach.

The primary tools you use to manage disks are the Disk Management snap-in and the DiskPart command-line utility. You must be a member of the local Administrators group, the Backup Operators group, or have been delegated permission to manage basic and dynamic disks. Only members of the local administrators group can format a disk.

2.2.2.1. Understanding partition styles

To allow files and file structures to be written on disks, you partition them. Two partition styles are used:

  • Master Boot Record (MBR)

  • GUID Partition Table (GPT)

The partition styles available on a particular computer depend on the chip architecture:

  • x86-based computers use the MBR partition style.

  • Itanium-based computers running 64-bit Windows use MBR and GPT partition styles.

  • X64-based computers running 64-bit Extended Systems versions of Windows use the MBR partition style.

The partition style provides the underlying methodology for partitioning disks. Windows structures disks and their contents according to storage type. Windows Server 2003 supports two storage types:


Basic disk

With basic disks, Windows uses partitions to map out the disk structure and the areas of the disk available for storage.


Dynamic disk

With dynamic disks, the unit of storage is the volume. All volumes on dynamic disks are known as dynamic volumes.

Basic disks are the industry standard and are accessible on just about every operating system. Dynamic disks, on the other hand, are specific to Windows 2000 and later. Dynamic disks are not supported for removable media, on portable computers, such as laptops and tablet PCs, or with disks connected via FireWire/USB.


Tip: Some computers ship with disks configured as dynamic disks. Any basic disk can be easily converted to a dynamic disk. However, dynamic disk volumes must be deleted before dynamic disks can be converted to basic disksa process that destroys the data on the disk.
2.2.2.2. Understanding special drive sections

Regardless of whether they are basic or dynamic, all disks have three special drive sections:


System

The system volume contains the hardware-specific files needed to load Windows.


Boot

The boot volume contains the operating system and operating system-related files.


Active

The active volume is the drive section from which the operating system starts.

One and only one of the primary partitions on the disk must be marked as active. Typically, the system, boot, and active partitions are the samei.e., most computers have one active partition, which is also the system partition and the boot partition.

2.2.2.3. Using basic disks

The way basic disks are used depends on the partition style:


MBR partition style

With MBR disk partitions on basic disks, logical volumes are represented using primary partitions and extended partitions containing logical drives. A basic disk can have up to four primary partitions, or up to three primary partitions and one extended partition. Each primary partition is represented with one logical volume. Each extended partition is represented by one or more logical drives. A logical drive is a logical volume that is used to represent all of or part of an extended partition.


GPT partition style

With GPT disk partitions on basic disks, multiple partitions are created during setup and installation of the operating system, including an EFI system partition (ESP), a Microsoft Reserved (MSR) partition, and a primary partition. The disk may also contain OEM partitions. GPT disks support up to 128 partitions, any number of which can be primary partitions. Only Itanium-based computers running 64-bit Windows use GPT disks.

MBR is the partition style you'll work with the most. Partitions and logical drives are used only on basic disks. You can extend a partition using the DiskPart command-line utility, provided that the partition is formatted using NTFS and is followed by a contiguous block of unallocated space on the same physical disk.


Tip: Under Windows NT 4.0, basic disks supported all the fault tolerant features of dynamic disks. When a computer is upgraded from Windows NT 4.0 to Windows Server 2003, you will have limited management capabilities for these fault tolerant features, such as the ability to repair a damaged volume set or to delete a volume set. You will also be able to upgrade the disks containing the volume set from basic disks to dynamic disks.
2.2.2.4. Using dynamic disks

Dynamic disks were introduced with Windows 2000 and provide improved manageability by requiring fewer restarts after configuration changes and by allowing disks to be combined or to create fault-tolerant disk sets. With dynamic disks, the unit of storage is the volume. All volumes on dynamic disks are known as dynamic volumes.

Although you can create up to 2,000 volumes on a dynamic disk, the recommended maximum number of volumes is 32. When a computer has multiple dynamic disks, you have additional options for combining disks and creating fault tolerant volumes. The difference between a non-fault tolerant volume and a fault tolerant volume is an important one:


Non-fault tolerant volumes

Provide no data redundancy or failure protection beyond that offered by the underlying filesystem. If a non-fault tolerant drive fails, you may not be able to rebuild the volume without recovering the data from backup.


Fault tolerant volumes

Provide data redundancy and failure protection beyond that offered by the underlying filesystem. If a fault tolerant drive fails, you can often rebuild the volume without having to recover data from backup.

Windows supports disk performance and fault tolerance options at the operating system level using redundant array of independent disk (RAID) technology. Another term for Windows-supported RAID is software RAID .


Tip: RAID can be implemented using hardware RAID controllers. Because hardware RAID operates at the hardware level, hardware RAID offers better performance than software RAID. Windows sees disks configured with hardware RAID as standard disks, which allows you to set the storage type and the partitioning separately from the underlying hardware implementation. You can format the disks as either basic disks or dynamic disks, and you can also apply software RAID.

As with basic disks, one and only one of the volumes on a dynamic disk must be marked as active, and the volume also is the system volume and the boot volume. With dynamic disks, the types of non-fault-tolerant and fault-tolerant volumes available are as follows:


Simple volume

The most basic type of volume on a dynamic disk, a simple volume, is the equivalent to a basic disk partition. Simple volumes can span space only on a single disk and are represented as single logical volumes. You can extend simple volumes to unallocated space on the same disk. Simple volumes are not fault tolerant and, as such, provide no redundancy.


Spanned volume

A spanned volume is used to combine unallocated space on multiple physical disks. Unallocated space on up to 32 physical disks can be combined to create a single spanned volume. The amount of space used on each disk can be different, and data is written to each volume in sequence, starting with the first volume. When space on the first volume fills, space on the next volume is used, and so on. You can extend spanned volumes to unallocated space as necessary to provide additional storage capacity. Spanned volumes provide no fault tolerance. If one of the disks of which the spanned volume consists fails, the entire volume fails and data must be recovered from backup.

Because of how data is written to spanned volumes, they offer poor performance and no fault tolerance. You cannot extend or span the system volume. Nor will Windows allow you to install the operating system on a spanned volume.


Striped volume

A RAID-0 or striped volume is used to combine unallocated space on multiple physical disks. As with spanned volumes, unallocated space on up to 32 physical disks can be combined to create a single striped volume. Unlike spanned volumes, the amount of space allocated to the volume on each disk must be identical, and data is written to all the physical disks in the volume at the same rate (through a technique called striping). Writing data to multiple disks increases write performance significantly. It also allows data to be read from multiple disks, which significantly improves read performance.

Although striped volumes offer improved read/write performance over spanned volumes, striped volumes provide no fault tolerance. If one of the disks of which the striped volume consists fails, then the entire volume fails and data must be recovered from backup. It should also be noted that you cannot extend striped volumes, nor can you stripe the system volume.


Mirrored volume

A RAID-1 or mirrored volume is used to create two identical copies of a volume. The amount of space allocated to the volume on each disk must be identical, and data is written to both disks through a technique called mirroring (if one disk controller is involved) or duplexing (if two disk controllers are involved). With standard mirroring, two independent writes are neededone to each diskwhich affects write performance. With duplexing, the two writes can be performed simultaneously using separate disk controllers, so write performance is the same as if one disk was being used.

Mirrored volumes provide fault tolerance. If one of the drives in the set fails, the other disk can continue to operate and there is no data loss. The failed drive must be replaced or another drive must be specified as the mirror partner to restore fault tolerance. Boot and system volumes can be mirrored.


Striped with parity volume

A RAID-5 or striped with parity volume is used to combine unallocated space on three or more physical disks. As with striped volumes, unallocated space on up to 32 physical disks can be combined to create a single striped volume, the amount of space allocated to the volume on each disk must be identical, and data is written to all the physical disks in the volume at the same rate (via striping). Unlike striping alone, RAID-5 writes the data with checksum information, called parity, which provides fault tolerance.

If one of the drives in a RAID-5 set fails, data on the failed disk can be regenerated using the parity information. The failed drive must be replaced or another drive must be specified as part of the volume to restore fault tolerance. System volumes cannot use RAID-5. If two disks in a RAID-5 set fail simultaneously, all data is lost and must be restored from backup.

Table 2-1 summarizes the volume types. Only Windows servers support fault-tolerant software RAID. Although Windows 2000 Professional and Windows XP Professional support disk spanning and disk striping, they do not support disk mirroring (RAID-1) or disk striping with parity (RAID-5). Microsoft recommends that you implement RAID-1 and RAID-5 only on identical disks.

Table 2-1. Volume types on dynamic disks (continued)

Volume type

Number of disks

Fault tolerance/performance

Simple

1

No, single disk read/write.

Spanned

2-32

No, possible read/write over multiple disks might mean poor performance.

Striped

2-32

No, striping to multiple disks can offer improved read/write performance.

Mirrored

2

Yes, supports single-drive failure, using two disk controllers (duplexing) gives better write performance than mirroring with a single disk controller.

Striped with parity

3-32

Yes, supports single-drive failure. Striping to multiple disks can offer improved read/write performance.


Table 2-2 compares the terms used with basic and dynamic disks. The most important thing to remember is the following: basic disks have partitions and within extended partitions there are logical drives. Dynamic disks have volumes and only server editions support fault-tolerant RAID.

Table 2-2. Terms used with basic and dynamic disks

Basic disks

Dynamic disks

Active, boot, system partition

Active, boot, system volume

Logical drive

Simple volume

Mirror set

Mirrored volume (RAID-1 volume)

Partition

Simple volume

Primary partition

Simple volume

Stripe set

Striped volume (RAID-0 volume)

Stripe set with parity

Striped set with parity volume (RAID-5 volume)

Volume set

Spanned volume


2.2.2.5. Understanding volume formatting

Primary partitions, logical drives on extended partitions, and volumes are formatted to create logical volumes. A logical volume must be formatted with a specific filesystem. Windows 2000 and later computers support three filesystems on basic and dynamic disks:


FAT (FAT16)

Uses 16-bit file allocation tables with maximum volume size of 4 GB.


FAT32

Uses 32-bit file allocation tables with maximum volume size of 2 TB; limited on Windows to 32 GB.


NTFS

Uses a master file table that contains a record for each file and volume as well as metadata on the volume itself. On Windows 2000 and later, NTFS supports 2 TB volumes on basic MBR disks.

NTFS supports advanced file permissions, disk quotas, remote storage, sparse files, file-based compression, and encryption. Because NTFS provides so many security, management, and resiliency features, usually you will want to format logical volumes using NTFS. The only time you wouldn't want to do this is if you have a specific performance reason or other issue.

2.2.2.6. Understanding volume mounting

When working with logical volumes, it is important to keep in mind that a logical volume may include more than one physical disk and it may also be used to present part of a disk with a single physical disk having multiple logical volumes. In Windows Server 2003, logical volumes are represented by:

  • A single drive letter

  • A mount point

Table 2-3 summarizes how drive letters and mount points are used. Generally, the drive letters E to Z are available for use with driver letters A and B being used with floppy/Zip drives, drive C for the primary disk, and drive D for the computer's CD/DVD-ROM drive. Logical volumes can be mounted to empty folders on NTFS volumes as well.

Table 2-3. Drive letter and mount point usage

Drive designator

Typical usage

A:, B:

Removable media drives, floppy/Zip

C:

Primary disk

D:

Primary CD/DVD-ROM drive

E: . . . Z:

Secondary disk, CD/DVD-ROM drive

Folder name

Mount point (NTFS only)


2.2.2.7. Using Disk Management

The Disk Management snap-in is installed by default in the Disk Management console (diskmgmt.msc) and in the Computer Management console (compmgmt.msc). Disk Management can be used to manage disk storage on both local and remote computers. Computer Management can be accessed from the Administrative Tools menu or by right-clicking My Computer on the Start Menu and then selecting Manage.

By default, Computer Management connects to the local computer. To connect to a remote computer, right-click the Computer Management node and select Connect To Another Computer. Then use the Select Computer dialog box to specify the name or IP address of the computer to which you want to connect.

Configuring disks and volumes using Disk Management is a five-step process:

  1. Install or attach the disk with the system powered off if required. The disk should be automatically installed and listed when you access Disk Management. If it isn't, right-click the Disk Management node and select Rescan Disks.

  2. Initialize the disk to make it available for use. When you start Disk Management after installing a disk, the Initialize Disk Wizard should appear automatically. If it doesn't, you can manually initialize the disk by right-clicking it in Disk Management and selecting Initialize Disk.

  3. New disks are initialized as basic disks by default and can be converted to dynamic disks if desired.

    • If you want to use the disk as a basic disk, you can then partition the disk by right-clicking the disk and selecting New Partition. If you create a primary partition, the primary partition becomes a logical volume. If you create an extended partition, you can create logical drives in the partition. Right-click an area of unallocated space in the extended partition and select New Logical Drive.

    • If you want to use the disk as a dynamic disk, you must convert the disk type. Right-click the disk's status box and select Convert To Dynamic Disk. After you convert the disk, you can add volumes by right-clicking an area of unallocated space on the disk and selecting New Volume.

  4. Format the volumes you've created as FAT, FAT32, or NTFS. You can do this as part of the volume creation process or afterward by right-clicking the volume and selecting Format.

  5. Assign drive letter or mount points. You can do this as part of the volume creation process or afterward by right-clicking the volume and selecting Change Drive Letters And Paths. Volumes can be mounted only to empty folders on existing NTFS volumes.

2.2.2.8. Using DiskPart

DiskPart is a command-line utility for managing disks. DiskPart can be used interactively or it can call a script to obtain a list of commands to execute. When you type diskpart at a command prompt and press Enter, you invoke the DiskPart interpreter, and the DISKPART> command prompt appears. You can obtain help at anytime be entering ?. DiskPart has commands for listing and selecting disks, partitions, and volumes. You should always select the specific disk, partition, or volume you want to work with before performing management tasks.

Configuring disks and volumes using DiskPart is a four-step process:

  1. Install or attach the disk with the system powered off if required. Invoke DiskPart by typing diskpart at a command prompt. Type list disk to list the available disks. The disk should be automatically installed and listed when you access DiskPart. If it isn't, type rescan.

  2. New disks are initialized as basic disks by default and can be converted to dynamic disks if desired. Type list disk to determine the number of the disk, and its size and status. Select the disk to specify that you want to work with by typing select disk n, where n is the number of the disk.

    • If you want to use the disk as a basic disk, you can create partitions using create partition primary create partition extended, and create partition logical.

    • If you want to use the disk as a dynamic disk, you must convert the disk type. Type convert dynamic. After you convert the disk, you can add volumes using create volume raid, create volume simple, and create volume stripe.

  3. Format the volumes you've created as FAT, FAT32, or NTFS. You cannot do this in DiskPart. To format volumes, you must exit DiskPart by typing exit and then run the FORMAT command. Type format /? for details on formatting volumes.

  4. After you format volumes, you can assign drive letter or mount points using DiskPart. Invoke DiskPart by typing diskpart at a command prompt. Type list disk to list the available disks. Select the disk you want to work with by typing select disk n, where n is the number of the disk. Type list partition or list volume to list the available partitions or volumes as appropriate. Select the partition or volume you want to work with by typing select partition n, where n is the number of the partition or typing select volume n, where n is the number of the volume. Assign the drive letter or mount point by typing assign letter=x, where x is the drive letter or assign mount=folderpath, where folderpath is the path to the empty NTFS folder on which to mount.

2.2.2.9. Extending volumes

You can extend simple or spanned volumes on dynamic disks using Disk Management or DiskPart. In Disk Management, right-click the volume and select Extend Volume. In DiskPart, select the disk and volume you want to work with, then type extend size=n, where n is the size in megabytes to extend the volume. If a partition is formatted using NTFS and is followed by a contiguous block of unallocated space on the same physical disk, you can extend a partition on a basic disk using the same technique.

2.2.3. Implementing RAID Solutions

RAID can be configured using hardware and software implementations. With hardware solutions, a controller card creates and maintains the RAID configuration, which typically is set up using vendor-provided software. With software solutions, Windows Server 2003 creates and maintains the RAID configuration at some cost to performance. As discussed previously, Windows supports:

  • Striping (RAID-0)

  • Mirroring (RAID-1)

  • Striping with parity (RAID-5)

2.2.3.1. Managing and maintaining striped volumes

Striping (RAID-0) uses unallocated space on 2 to 32 dynamic disks and writes data to all disks at the same rate. To create a striped volume, follow these steps:

  1. Open Disk Management, right-click an area of unallocated space on one of the disks, and then choose New Volume. This starts the New Volume wizard.

  2. In the New Volume wizard, click Next, and then select Striped.

  3. Click Next, and then follow the onscreen instructions for selecting disks and sizing the volume.

Striped volumes must be formatted using NTFS and can be assigned a drive letter or a mount point. Boot and system volumes cannot be striped. If any disk that is part of the striped volume fails, the entire volume will fail and be unusable. To recover the striped volume you must:

  1. Delete the volume.

  2. Replace the failed disk.

  3. Recreate the volume.

  4. Restore the data from backup.

2.2.3.2. Managing and maintaining mirrored volumes

Mirroring (RAID-1) uses an identical amount of space on two disks to create a fault tolerant volume. Since all data is written to both volumes, single-drive write performance can be achieved using two disk controllers (a process called duplexing ). To create a new mirrored volume from unallocated space, follow these steps:

  1. Open Disk Management, right-click an area of unallocated space on one of the disks, and then choose New Volume. This starts the New Volume wizard.

  2. In the New Volume wizard, click Next, and then select Mirrored.

  3. Click Next, and then follow the onscreen instructions for selecting disks and sizing the volume.

Mirrored volumes must be formatted using NTFS and can be assigned a drive letter or a mount point. Unlike striped volumes, boot and system volumes can be mirrored. To mirror an existing volume, follow these steps:

  1. Open Disk Management, right-click an existing volume on a dynamic disk, and select Add Mirror.

  2. In the Add Mirror dialog box, select one of the available dynamic disks on which to create the mirror, and then click Add Mirror.

Mirrored volumes can fail in several ways. The way you repair the mirror depends on the error status shown in Disk Management for the disk and volume:

  • If data is not written to both volumes, which may occur if there are I/O errors during write operations, the mirrored volume is said to have failed redundancy. To correct a Failed Redundancy status, open Disk Management, right-click one of the volumes in the set, and choose Resynchronize Mirror. This forces Windows to resynchronize the data.

  • If one of the drives in the mirrored volume has a status of Failed, Online (Errors), or Unreadable, open Disk Management, right-click the failed or missing drive, and then choose Rescan Disks. When this process finishes, right-click the drive and choose Reactivate. If the Healthy status isn't restored, right-click the volume and choose Resynchronize Mirror.

If you are unable to recover the mirror, which may occur if a disk is bad, you will need to rebuild the mirror by following these steps:

  1. Replace the failed disk or have an alternate disk for use in mirroring.

  2. Right-click the failed volume and then select Remove Mirror.

  3. Right-click the remaining volume from the original mirror and select Add Mirror.

  4. In the Add Mirror dialog box, select one of the available dynamic disks on which to create the mirror and then click Add Mirror.

2.2.3.3. Managing and maintaining striped with parity volumes

Striping with parity (RAID-5) uses an identical amount of space on 3 to 32 disks to create a fault tolerant volume. Data is written to all the physical disks in the volume at the same rate using striping. Checksum information in the form of parity is written with the data to provide fault tolerance. To create a new RAID-5 volume from unallocated space on three or more disks, follow these steps:

  1. Open Disk Management, right-click an area of unallocated space on one of the disks, and then choose New Volume. This starts the New Volume wizard.

  2. In the New Volume wizard, click Next, and then select RAID-5.

  3. Click Next, and then follow the onscreen instructions for selecting disks and sizing the volume.

RAID-5 volumes must be formatted using NTFS and can be assigned a drive letter or a mount point. Like striped volumes, system volumes cannot use RAID-5.

Like mirrored volumes, RAID-5 volumes can fail in several ways. The way you repair the volume depends on the error status shown in Disk Management for the disk and volume:

  • If one of the disks in the volume is missing or offline, right-click the failed or missing drive, and then choose Rescan Disks. When this process finishes, right-click the drive and choose Reactivate. If the Healthy status isn't restored, right-click the volume and choose Regenerate Parity.

  • If parity is not written correctly to all volumes, which may occur if there are I/O errors during write operations, the RAID-5 volume is said to have failed redundancy. As before, you should try rescanning and then reactivating the problem drive. If the Healthy status isn't restored, right-click the volume and choose Regenerate Parity.

If one of the disks in the volume won't come back online, which may occur if a disk is bad, you will need to rebuild the volume by following these steps:

  1. Replace the failed disk or have an alternate disk available for use.

  2. Right-click the failed volume and then select Remove Volume.

  3. Find an area of unallocated space on a dynamic disk not used by the volume that is at least as large as the region to repair in size. Note the disk number.

  4. Right-click the RAID-5 volume and select Repair Volume. When prompted to specify where the missing volume should be recreated, select Disk Previously Located.

2.2.4. Maintaining Disks

Several tools are provided for maintaining disks, including Check Disk (CHKDSK.EXE) and Disk Defragmenter (DFRG.MSC). You use Check Disk to check for and repair disk errors. You use Disk Defragmenter to reorganize a disk's files and folders to optimize performance.

2.2.4.1. Using Check Disk

Check Disk (CHKDSK.EXE) scans the surface of disks, checking the integrity of files and folders while looking for and correcting errors, such as lost clusters and invalid file indexes. Check Disk can be run interactively or from the command prompt.

To run Check Disk interactively, open Disk Management or My Computer, right-click the volume, and then select Properties. On the Tools tab of the disk's properties dialog box, click Check Now. By default, Check Disk looks for errors only. If you want Check Disk to search for and correct errors, you should select Automatically Fix File System Errors and Scan For And Attempt Recovery Of Bad Sectors before clicking Start, as shown in Figure 2-5.

Figure 2-5. Use Check Disk to search for and correct errors.


To run Check Disk from the command line, type chkdsk followed by the drive designator, such as chkdsk c:. Use the optional parameter /f to automatically fix filesystem errors and /r to scan for and attempt recovery of bad sectors. All parameters available can be listed by typing chkdsk /?.


Tip: Without any switches, the chkdsk utility works in error-checking only mode on the drive you are working on. chkdsk moves the data found on a bad sector to a good sector only if this is supported based on the volume type. Otherwise, chkdsk cannot recover data on bad sectors and data may have to be recovered from backup.

Whether working interactively or from the command prompt, keep in mind Check Disk may need exclusive disk access to some files to fix errors. If exclusive access to files isn't available, you'll be prompted to schedule the disk check to occur next time you restart the computer. Adding the /x parameter at the command line can force the nonsystem volumes to dismount before checking the disk. System volumes cannot be dismounted in this way.

2.2.4.2. Using Disk Defragmenter

Disk Defragmenter (DFRG.MSC) checks for and corrects fragmentation problems on disks. Fragmentation can occur in a disk's Master File Table (MFT) or paging file, as well as in the files and folders stored on the volume.


Tip: Disk Defragmenter works only on local computers. For defragmenting remote computers, you'll need a third-party utility. You must have at least 15 percent free space on the disk where you want to run Disk Defragmenter.

On FAT, FAT32, and NTFS volumes, files, folders, and related disk structures are stored in units called clusters . Only one file can be written to a particular cluster. The default cluster size for NTFS is 4 KB. When this cluster size is used, files that are 4 KB or smaller are written to a single cluster on the disk, and files larger than 4 KB are written to multiple clusters.

For read/write operations, the operating system can write and read files faster when clusters are written in sequential or nearly sequential clusters. If there are large gaps between the file clusters, the disk controller must seek across the disk for clusters, which reduces read/write performance.

To run Disk Defragmenter interactively, open Disk Management or My Computer, right-click the volume, and then select Properties. On the Tools tab of the disk's properties dialog box, click Defragment Now. Using Disk Defragmenter is a two-part processyou must click Analyze to analyze the disk and determine the level of fragmentation. Disk Defragmenter will prompt to defragment the disk if this is recommended based on the current disk usage. Click View Report to see a detailed report of the disk usage. Begin defragmenting the disk by clicking Defragment.

To run Disk Defragmenter from the command line, type defrag, followed by the drive designator, such as defrag c:. Disk Defragmenter will then analyze the disk and begin defragmenting the disk if this is required. If you want only to analyze the volume, use the -a parameter. Other parameters available include -v for verbose output and -f to force defragmentation to occur even if the disk has low free space.

Whether working interactively or from the command prompt, Disk Defragmenter resolves fragmentation problems by attempting to rearrange files so they use consecutive clusters and by consolidating free space.




MCSE Core Required Exams in a Nutshell
MCSE Core Required Exams in a Nutshell: The required 70: 290, 291, 293 and 294 Exams (In a Nutshell (OReilly))
ISBN: 0596102283
EAN: 2147483647
Year: 2006
Pages: 95

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