Optimizing Server Disk Performance


Objective:

Optimize server disk performance

  • Defragment volumes and partitions

Windows Server 2003 comes with three fairly robust, built-in tools that you can use to perform basic troubleshooting, cleanup, and repair operations:

  • Disk Cleanup This utility removes temporary files and other "deadwood" that may be on your computer's disks.

  • Check Disk This utility checks the file and folder structure of your hard disk. You can also have Check Disk check the physical structure of your hard disk. Check Disk can perform repairs as required.

  • Disk Defragmenter This utility defragments your hard disks by moving all pieces of each file into a continuous section on the hard disk.

We examine each of these tools in the following subsections.

Using the Disk Cleanup Utility

The Disk Cleanup utility can remove temporary files, installation logs, Recycle Bin items, and other deadwood that accumulates on your volumes over time. You can start the Disk Cleanup utility in three ways, depending on your needs:

  • On the General tab of the volume's Properties dialog box, click the Disk Cleanup.

  • From the Start menu, click All Programs, Accessories, System Tools, Disk Cleanup.

  • On the command line, enter cleanmgr /d x, where x represents the volume to be cleaned. The /d switch is mandatory and specifies the volume to be cleaned.

Step by Step 12.23 details how to run the Disk Cleanup utility.

Step by Step

12.23 Running Disk Cleanup

1.

Open either My Computer or Windows Explorer. Right-click the drive that you want to run Disk Cleanup on and select Properties.

2.

From the Properties page, select the General tab and click the Disk Cleanup button.

3.

From the Disk Cleanup dialog box, select the files to delete or compress and then click OK.

4.

When the Disk Cleanup finishes, click OK.

By selecting the More Options tab in the Disk Cleanup dialog box, you are presented with other options to create free space on your drive, such as removing Windows components or other programs that you don't use. The Disk Cleanup utility can be configured for scheduled cleaning by using the Scheduled Tasks Wizard located in the Control Panel.

Using the Check Disk Utility

The Check Disk utility can be used to check the file and folder structure of your hard disks as well as to check the physical structure of your hard disks. Check Disk can also be configured to automatically correct any errors located. Check Disk can be launched by using one of the following methods:

  • As a GUI utility, Check Disk can be launched from the Tools tab of the volume's Properties dialog box.

  • As a command-line utility, Check Disk can be launched by entering chkdsk on the command line.

Step by Step 12.24 details how to run the GUI version of the Check Disk utility.

Step by Step

12.24 Running Check Disk from the GUI

1.

Open either My Computer or Windows Explorer. Right-click the drive that you want to run Check Disk on and select Properties.

2.

From the Properties page, select the Tools tab and click the Check Now button.

3.

From the Check Disk New Volume dialog box, shown in Figure 12.23, select the desired checking options and then click Start.

Figure 12.23. Select the disk tests to run.


4.

When the Check Disk utility finishes, click OK.

The GUI version of Check Disk can fix most minor problems. However, there are times when you need to have more options available for checking your disks. The command-line Check Disk utility, CHKDSK.EXE, offers more flexibility.

The chkdsk command has the following syntax:

chkdsk [volume[[path]filename]]] [/F] [/V] [/R]  [/X] [/I] [/C] [/L[:size]]


Table 12.1 presents the options for use with the chkdsk command.

Table 12.1. The Options for the chkdsk Command

Switch

Description

volume

Specifies the drive letter, mounted drive, or volume letter.

filename

Specifies the files to check for fragmentation (FAT only).

/F

Specifies that errors are to be fixed if found on the disk.

/V

Specifies that clean-up messages are to be displayed.

/R

Specifies that bad sectors are to be recovered. Requires the /F switch.

/L:[size]

Specifies the log size to be created.

/X

Specifies that the selected volume is to be dismounted if required. Requires the /F switch.

/I

Specifies that less vigorous checking of index entries is to be performed.

/C

Specifies that checking of cycles within the folder structure is to be skipped.


Using the Disk Defragmenter Utility

It was once thought that NTFS could not become fragmented. However, it was soon discovered that NTFS becomes fragmented the same as FAT and FAT32 do. Starting with Windows 2000, Microsoft includes a "light" version of Executive Software's Diskeeper, relabeled as the Disk Defragmenter utility, that is used for performing disk defragmentation.

The purpose of a defragmentation tool is to analyze a volume or partition and determine whether each file occupies a contiguous space. During the normal operation of a server, files are written, deleted, and rewritten. If a file needs to be added to, it must be given space wherever free space is available, and the free space might not necessarily be located next to the space that the file currently occupies. As a file is rewritten over and over, parts of it may be scattered all over the volume. This can slow down the access time for the file because it has to be read from various locations. In addition, new files and programs may be installed in pieces because there is no contiguous free space left on the drive large enough to store the new program. Over time, this slows the I/O performance of the volume.

After the defragmentation program has analyzed the volume, it can then consolidate the files and folders by moving the data around until the each of the files and folders are located in contiguous space on the volume. In addition, the defragmentation program consolidates the free space at the end of the volume so that new programs and files can be installed in contiguous space. The defragmentation utility included with Windows Server 2003, Disk Defragmenter, can defrag both NTFS and FAT volumes and partitions.

Note: Free Space Limitations

The GUI version of the Disk Defragmenter in Windows Server 2003 will not defragment a disk that has less than 15% free space.


You can access the Disk Defragmenter utility by following any one of these five methods:

  • On the Tools tab of the volume's Properties dialog box, click the Defragment Now button.

  • From the Start menu, click All Programs, Accessories, System Tools, Disk Defragmenter.

  • From within the Computer Management console, click Disk Defragmenter, as shown in Figure 12.24.

    Figure 12.24. Disk Defragmenter in the Computer Management console.

  • On the command line or from the Run dialog box, enter dfrg.msc.

  • On the command line or from the Run dialog box, enter MMC. In the empty console, add the Disk Defragmenter snap-in. This can be useful for creating powerful, customized MMC consoles for a variety of management tasks.

No matter which way you start Disk Defragmenter, your options are the same. To analyze a volume, click the Analyze button. You can defragment a volume, with or without first analyzing it, by clicking the Defragment button. The View Report button shows the analysis report again. You can pause or stop a running defragmentation.

The Disk Defragmenter utility can be configured for scheduled cleaning by using the Scheduled Tasks Wizard located in the Control Panel.

Tip:

Check out the full version of Diskeeper at www.executivesoftware.com/diskeeper/diskeeper.asp.


In addition to the GUI defragmentation utility, there is also a command-line utility. The command-line version of Disk Defragmenter can be used in scripts, and it also has an option to force a defragmentation to take place when there is less than 15% free space on the volume or partition.

When started from the command line, the defrag.exe command has the following syntax:

defrag [volume[[path]filename]]] [/A] [/V] [/F]


Table 12.2 presents the options for use with the defrag command.

Table 12.2. The Options for the defrag Command

Switch

Description

volume

Specifies the drive letter, mounted drive, or volume letter.

filename

Specifies the files to check for fragmentation (FAT only).

/A

Performs an analysis of the volume, displays a summary report, and indicates whether a defragmentation is required.

/V

Verbose. Displays a full analysis report.

/F

Forces a defragmentation of the volume, even if the free space is less than 15%.





MCSA. MCSE 70-290 Exam Prep. Managing and Maintaining a MicrosoftR Windows ServerT 2003 Environment
MCSA/MCSE 70-290 Exam Prep: Managing and Maintaining a Microsoft Windows Server 2003 Environment (2nd Edition)
ISBN: 0789736489
EAN: 2147483647
Year: 2006
Pages: 219
Authors: Lee Scales

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