Software

Get more out of Windows Vista's Disk Defragmenter

Windows Vista's Disk Defragmenter is configured to run on a regular schedule right out of the box. And when it runs, it's hidden in the background with no visible interface or icon. This means that Disk Defragmenter will always keep your hard disk in tip-top shape and you never even have to think about defragmenting it yourself.

This is an awesome improvement because disk fragmentation can take a huge toll on the overall performance of your operating system. It can be the source of long boot-times, random crashes, and unexplained lock-ups. In fact, an extremely fragmented hard disk can even prevent a system from booting up.

Since Vista's developers have totally automated the disk defragmenting operation, they pared down the user interface in Disk Defragmenter to a simple dialog box consisting of just two buttons, as shown in Figure A-one that opens a scheduling dialog box and one that allows you to manually launch the defragmenting operation.

Figure A

Vista's developers pared down the Disk Defragmenter user interface to a simple dialog box.
When you do manually launch the defragmenting operation, all you see is a message telling you that the hard disk is being defragmented, as shown in Figure B. While this simplistic user interface is aimed at making the task of defragmenting a hard disk easy for the new user, it can be a little disheartening to some of us old computer users who grew up with disk defragmenting utilities that provided all sorts of feedback. For instance, older versions of Disk Defragmenter provided you with a fragmentation analysis report as well as an animated graphic of the actual defragmentation process in operation.

Figure B

When you manually launch Windows Vista's Disk Defragmenter, the only feedback you get is a message telling you that the hard disk is being defragmented.

In this edition of the Windows Vista Report, I'll show you how you can get a bit more information out of the Windows Vista's Disk Defragmenter. As I do, I'll give you a little refresher course on the problem of disk fragmentation-just so you know what you're missing.

The problem of disk fragmentation

Chances are that you probably already know that disk fragmentation is a normal occurrence that happens over time as you use your hard disk. However, let's take a closer look.

On the hard disk, a cluster is the smallest unit of disk space that the operating system can address and is the smallest amount of space that can be allocated to a file. On a typical hard disk formatted with NTFS, the maximum default cluster size is 4KB or 4,096 bytes.

Every time you copy new files to and delete old files from your hard disk, as well as when you add information to existing files, chances are good that your hard disk is becoming more and more fragmented with each operation you perform. For example, when you copy a file to your hard disk, the operating system attempts to place the file into the first available cluster that it finds on the hard disk. If the file is larger than that cluster, the operating system breaks the file into pieces and attempts to place the rest of the file in the next available clusters. If these subsequent clusters are not located right next to the first one, the file is fragmented.

Fragmentation also occurs when you add information to an existing data file. If the file that you're working on outgrows its original cluster, the operating system will place the rest of the file in the next available cluster. Again the file becomes fragmented when the next available cluster isn't located right next to the first one. Furthermore, each time you delete files from your hard disk, you create available clusters, thus increasing the chances for future file fragmentation-especially if the files you delete are themselves fragmented.

Over time, fragmentation can become a big problem if left unchecked. As pieces of files become spread out, the hard disk's read/write heads have to do more work to locate and transfer files to memory. The more the read/write heads move, the longer it takes to access files. Consequently, hard disk performance suffers.

Getting more info

Although you don't get much feedback in Vista's Disk Defragmenter user interface, the Defrag command line tool is still alive and well and is more than capable of providing you with a detailed fragmentation analysis report. To get to this report, click the Start button and type CMD in the Start Search box. When you see the CMD menu item, right-click on it, and select the Run as Administrator command. You'll then see a UAC and will need to respond accordingly.

When the Administrator: Command Prompt window appears, type the command Defrag C: -v and press [Enter]. In a couple of minutes, you'll see a fragmentation analysis report for your hard disk, similar to the one shown in Figure C.

Figure C

The Defrag command line tool is capable of providing you with a detailed fragmentation analysis report.

Now, you can see just how effective the automated disk defragmentation process is. Notice that on my example hard disk, the percent of file fragmentation is zero and only five folders are fragmented.

Getting a visual

While you can't really get an animated graphic of the actual defragmentation process in operation in Vista, you can watch the disk activity by using the Disk graph in the Resource Overview section of the Reliability and Performance monitor. To launch it quickly, just click the Start button, type reliability in the Start Search text box and press [Enter]. You'll then see a UAC and will need to respond accordingly.

Next, click the Show/Hide Console Tree and the Show/Hide Action Pane buttons to close those parts of the interface and make the Resource Overview fill the window. To get an even better view, you can maximize the window. Then, click the arrow on the Disk header to reveal the Disk Detail Table.

The Disk graph will be very active while Disk Defragmenter is working. Keep in mind that the current I/O is in green and the highest active time percentage is in blue. In the Disk Detail Table, you can follow along as works with each file. Admittedly, the technique isn't as graphically entertaining as say Windows 98's Disk Defragmenter or even Windows XP's Disk Defragmenter, but it does give you that same sense of accomplishment.

About Greg Shultz

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

Editor's Picks

Free Newsletters, In your Inbox