1 of 15

How to defrag a computer

by Greg Schwartz

To understand how to defrag (or "defragment") a computer, let's first look at what fragmentation and defragmentation are.

Fragmentation occurs on your hard drive over a period of time and can noticeably slow your system down. Basically it is the dividing up of a single file to be stored on multiple areas of the disk.

Every time you save a file, Windows writes it to the hard drive, in the first available spot. All files are saved in "clusters" - chunks of data grouped together for easier access. A cluster takes up a defined amount of space on the hard drive. (For example, a Word document might take up four clusters.)

Let's assume you just created a text file with someone's address in it. The text file is written to the hard drive and (for the sake of argument) it only takes up one cluster. Now, the next time you save a file, Windows will store it in the adjacent spot on the hard drive. Suppose that file is a huge Excel spreadsheet, with the names and monthly stats of everyone in your company. This massive file takes up five clusters, so Windows writes it to the five clusters next to your text file.

The next day you realize that you don't need that text file, because you already have the address in it written down in your address book at home. So you delete the text file, and now your hard drive has a free cluster where the file used to be.

A friend emails you a funny cartoon that you want to save. The cartoon is a JPEG file that takes up three clusters. Now Windows has a dilemma... the first empty space it sees is the spot where your text file used to be, but that spot can only hold one cluster. So Windows fragments the file.

The first cluster of the JPEG is stored where the text file was, and the remaining two clusters are written to the next available free spaces Windows can find. This is all fine and dandy, because the whole file has been saved, and Windows made a note of where to find all the pieces. So you can view the cartoon any time you want.

The main problem fragmentation causes is speed. During the course of a day your computer accesses the hard drive (either for reading or writing) many times, and each time it has to find all the different clusters for whatever file it wants.

Defragmentation is the process of reorganizing the hard drive so that all the different clusters of a single file can be stored next to each other. Most PC technicians will recommend defragmenting your hard drive at least once a month. On a freshly-defragmented computer, hard drive access speed is much higher than it was previously. And the less time your hard drive spends spinning so Windows can find specific clusters, the longer the drive will last, resulting in longer data storage and less expense for you, the user.

All current versions of Windows come with a defragmentation tool. To access this tool in Windows XP, go to My Computer (either from the Start Menu or the Desktop) and right-click on your hard drive (typically, this is the C: drive). Under the Tools tab, select Defragment Now, and Windows will launch the Disk Defragmenter.

Before running the Defragmenter, you should close all open programs. If you're planning on deleting old files or running Disk Cleanup, you should do that before defragmenting. Otherwise, the empty spaces left by the deleted files will just cause new files to be fragmented.

Click on the Defragment button toward the bottom of the window, and the program will do the rest. Depending on how fragmented your hard drive is, it may take most of an hour for the defragmenter to run, so you might want to start it before you go to sleep.

Once the defragmenter has finished running, it will show you a before-and-after line graph of your hard drive's fragmentation. Ideally you want a fragmentation level of 1.0 (which means all clusters are continuous, and not fragmented at all).

There are third-party defragmentation tools that you can download or buy (such as Diskeeper but unless you have a specific need that another program can fill, Windows' defragmentation tool should work well enough for most users.

Now that your hard drive is nice and organized, remember to run the defragmenter on a regular basis to keep it speedy and healthy.

Helium, Inc.
200 Brickstone Square Andover, MA 01810 USA