3.1. Viewing the Disk, Drive, and Volume Layout

Problem

You want to see how the disks, drives, and volumes are laid out on a server.

Solution

Using a graphical user interface

  1. Open the Computer Management snap-in.

  2. In the left pane, expand Storage and click on Disk Management. The right pane will display the disk, volumes, and drives.

Using a command-line interface

On Windows Server 2003, you can use the diskpart utility to view the disk, drive, and volume configuration. First, get into interactive mode:

> diskpart

Next, to view the list of disks, run the following:

> list disk

Now, to see the list of volume and assigned drive letters, run the following:

> list vol

Tip

Unfortunately, there isn't an equivalent utility on Windows 2000.

Using VBScript

' This code enumerates the physical and logical disks on a system. ' ------ SCRIPT CONFIGURATION ------ strComputer = "." ' ------ END CONFIGURATION --------- WScript.Echo "Physical Disks:" set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") set colDisks = objWMI.ExecQuery("select * from Win32_DiskDrive") for each objDisk in colDisks WScript.Echo " Caption: " & vbTab & objDisk.Caption WScript.Echo " Device ID: " & vbTab & objDisk.DeviceID WScript.Echo " Manufacturer: " & vbTab & objDisk.Manufacturer WScript.Echo " Media Type: " & vbTab & objDisk.MediaType WScript.Echo " Model: " & vbTab & objDisk.Model WScript.Echo " Name: " & vbTab & objDisk.Name WScript.Echo " Partitions: " & vbTab & objDisk.Partitions WScript.Echo " Size: " ...

Get Windows Server Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.