16.3 Disk Defragmenter


When you save a new file, Windows records its information onto the hard drive in small pieces called blocks . On a new PC, Windows lays the blocks end-to-end on the hard drive surface. Later, when you type more data into a document (thus enlarging it), the file no longer fits in the same space. Windows XP puts as much of the file in the original location as can fit, but may have to store a few of its blocks in the next empty spot on the hard drive.

Ordinarily, you'll never even notice that your files are getting chopped up in this way, since they open promptly and seamlessly. Windows keeps track of where it has stored the various pieces, and reconstitutes them when necessary.

As your drive fills up, the free space that's left is made up of smaller and smaller groups of blocks. Eventually, a new file may not fit in a single "parking place" on the hard drive surface, since there are no free spaces left that are large enough to hold it. In fact, Windows may have to store a file in several different areas of the disk, or even hundreds.

When you later try to open such a fragmented file, the drive heads (which read the disk) must scamper all over the disk surface, rounding up each block in turn , which is slower than reading contiguous blocks one after the other. Over time, this file fragmentation gets worse and worse and may eventually result in noticeable slowdowns when you open or save files.

The solution: Disk Defragmenter, a program that puts together pieces of files that have become fragmented (split into pieces) on your drive. The "defragger" also rearranges the files on your drives to make the operating system and programs load more quickly. Although Disk Defragmenter takes some time to do its thing, a freshly defragged PC feels faster and more responsive than a heavily fragmented one.

NOTE

Fragmentation doesn't become noticeable except on hard drives that have been very full for quite a while. Don't bother defragmenting your drive unless you've actually noticed it slowing down. The time you'll spend waiting for Disk Defragmenter to do its job is much longer than the fractions of seconds caused by a little bit of file fragmentation.

16.3.1 Defragmenting a Drive

Before you run Disk Defragmenter, exit all programs, disable your antivirus software, empty the Recycle Bin, and plan some time away from the PC ”remember, defragging is time-consuming . Depending on the size of your drive, the number of files on it, how fragmented it is, and especially how much free space is available, the Disk Defragmenter can take all day to run.

Defragmenting also puts your hard drive into a temporarily delicate condition. Therefore, don't defragment if your hard drive is ailing, if there's a thunderstorm , when your laptop is running on battery, or when you've set up the Task Scheduler (see Section 16.6) to trigger automatic tasks .

NOTE

During the defragmentation process, Windows picks up pieces of your files and temporarily sets them down in a different spot, like somebody trying to solve a jigsaw puzzle. If your hard drive is very full, defragmenting will take a lot longer than if you have some empty space available ”and if there's less than fifteen percent free, Windows can't do the job completely. Before you run Disk Defragmenter, then, use Disk Cleanup and make as much free disk space as possible.

To open the Disk Defragmenter program, log on using an Administrator account (Section 17.3.1), and then use any of these techniques:

  • Choose Start All Programs Accessories System Tools Disk Defragmenter.

  • Choose Start My Computer. Right-click the icon of a hard drive; from the shortcut menu, choose Properties. In the Properties window, click the Tools tab, and then click Defragment Now.

  • Choose Start Run. Type dfrg.msc and press Enter.

NOTE

Throughout Windows, and throughout its book and magazine literature, disks are referred to as volumes . Usually, volume means disk. But technically, it refers to anything with its own disk icon in the My Computer window ”including disk partitions (Section 16.5.2), Zip disks, DVDs, and so on. Section 15.1.1 has details.

The Disk Defragmenter window opens, listing your hard drives.

  1. Click the drive you want to work on.

    Unless you have multiple hard drives, the C: drive is already selected.

  2. Click Analyze.

    The program takes a minute to study the condition of the files on your hard drive. If, in its considered opinion, defragmenting is worth the time and effort, a message will tell you so (see Figure 16-4).

    Figure 16-4. Windows lets you know whether or not you'll gain anything by defragmenting your hard drive (top). If you're terminally curious , click View Report. A dialog box then appears (like the one here at bottom), listing each individual file on your hard drive and revealing the extent of its fragmentation.
    figs/16fig04.gif
  3. Click Defragment.

    Disk Defragmenter works by juggling file segments, lifting some into memory and depositing them elsewhere on the drive, then moving smaller files into the newly created free space. This shuffling process goes on for some time, as file fragments and whole files are moved around until every file lies on the drive in one piece.

    Technically, in fact, Defragmenter doesn't rejoin file fragments randomly . In restoring them, Disk Defragmenter tries to organize the files better on the hard drive surface, using logic to position them so that applications will open up as quickly as possible.

    A progress bar at the bottom of the window lets you know how far along it is. You can wander away to watch TV ”or, if you're fascinated by this kind of thing, you can watch the colorful graphs (Figure 16-5).

    Figure 16-5. A detailed view of the defragmentation process helps you understand what Disk Defragmenter is doing. The color of each little square shows what's going on, as the program juggles software files, system files, and data files to put each file in the best possible place. At that point of perfection , Disk Defragmenter announces victory over fragmentation and asks if you want to close the program. Say Yes unless you have another hard drive that needs defragging.
    figs/16fig05.gif

For best results, leave your PC alone while the defragmenting process is going on. If you absolutely must perform a task at your computer during the defragging process, click Pause.

If you save a file while the drive is being defragmented (whether you pause the program or not), Disk Defragmenter starts the process over from the beginning.

NOTE

Disk Defragmenter isn't the only tool for this job. Programs like Norton Utilities include additional features. For example, because they track how often you use the various files on your drive, they can store the most frequently used files at the beginning of the disk for quicker access. In some programs, you can even choose which files go at the beginning of the disk.

Do these additional features actually produce a measurable improvement over Windows XP's built-in defragger? That's hard to say, especially when you remember the biggest advantage of Disk Defragmenter: it's free.



Windows XP Pro. The Missing Manual
Windows XP Pro: The Missing Manual
ISBN: 0596008988
EAN: 2147483647
Year: 2003
Pages: 230

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