Introduction


Before you can start using a filesystem on a server, you have to configure the disks, drives, and volumes. You have to split up the disks into volumes and assign drive letters to the volumes. You have to format a volume with a filesystem such as NTFS or FAT32. Filesystems are what give you features such as security, compression, and encryption of files and folders. Once you have usable volumes in place, there are many ongoing maintenance tasks you should do to keep your disks healthy. You'll want to periodically defragment your volumes so that new files aren't spread across many separate chunks, which decreases file access performance. You'll want to check your volumes for errors to ensure there aren't any bad sectors. And if you start running low on space, you may want to clean up a volume or see which users are using the most space. If disk space usage is a concern for you, you can implement the Windows quota feature that lets you limit the amount of space users' use. In this chapter, I cover all of these tasks and more.

Using a Graphical User Interface

The two primary graphical interfaces for managing disks, drives, and volumes are Windows Explorer and the Disk Management snap-in. With Windows Explorer, you can right-click a drive, select Properties, and perform functions such as enabling quotas, running disk cleanup, performing defragmentation, and running an error check.

The Disk Management snap-in lets you perform lower-level disk administration and volume management. With it you can create new volumes, assign drive letters, format volumes with a particular filesystem, and convert basic disks to dynamic disks.

Using a Command-Line Interface

Several important new command-line utilities have been added to Windows Server 2003 to help with managing disks and volumes. Tools such as diskpart and fsutil allow you close to complete control over disks, drives, and volumes from the command line. Most of these new command-line tools also provide interfaces for running in batch mode, which make them easy to script. It is worth your time to get familiar with the capabilities of these tools.

Table 3-1 lists the command-line tools used in this chapter.

Table 3-1. Command-line tools used in this chapter

Tool

Windows Server 2003

Windows 2000 Server

Recipes

chkdsk

%SystemRoot%\system32

%SystemRoot%\system32

3.10

cleanmgr

%SystemRoot%\system32

%SystemRoot%\system32

3.7

compact

%SystemRoot%\system32

%SystemRoot%\system32

3.9

defrag

%SystemRoot%\system32

N/A

3.8

diruse

Windows 2003 Support Tools

Window 2000 Resource Kit

3.14

diskpart

%SystemRoot%\system32

N/A

3.1, 3.2, 3.5

diskperf

%SystemRoot%\system32

%SystemRoot%\system32

3.3

diskuse

Windows 2003 Resource Kit

Windows 2000 Resource Kit

3.14

format

%SystemRoot%\system32

%SystemRoot%\system32

3.4

fsutil

%SystemRoot%\system32

N/A

3.15-17

label

%SystemRoot%\system32

%SystemRoot%\system32

3.6

net use

%SystemRoot%\system32

%SystemRoot%\system32

3.12

subst

%SystemRoot%\system32

%SystemRoot%\system32

3.13

vrfydsk

Windows 2003 Resource Kit

N/A

3.10

writeprot

http://joeware.net

N/A

3.11


Using VBScript

Just as several new command-line tools were added to Windows Server 2003, so were some important new WMI classes. Specifically, the Win32_Volume class allows you to perform a variety of volume management tasks including running a chkdsk, defragmentation, and format of a volume.

Table 3-2 lists the WMI classes used in this chapter. The only important exception to note is that I use the MapNetworkDrive WSH method in Recipe 3.12.

Table 3-2. WMI classes used in this chapter

WMI class

Description

Recipes

CIM_Datafile

Enumerate and manage files.

3.14

Win32_Directory

Enumerate directories.

3.9

Win32_DiskDrive

Enumerate and manage physical disks.

3.1

Win32_DiskQuota

Enumerate the quota usage for a particular user.

3.16-17

Win32_LogicalDisk

Enumerate and manage logical disks.

3.1, 3.10, 3.16, 3.17

Win32_MappedLogicalDisk

Enumerate and manage mapped network drives.

3.1

Win32_QuotaSetting

Enumerate and manage disk quota settings on volumes. This class is available only with Windows XP and Windows Server 2003.

3.15

Win32_Volume

Enumerate and manage volumes. This class is available only with Windows Server 2003.

3.4-3.6, 3.8




Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

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