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’s surface. Later, when you type more data into a document (thus enlarging it), the file no longer fits in the same space. Windows puts as much of the file in the original location as can fit, but it 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, though, 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’s surface, since there are no free spaces left large enough to hold it. Windows may have to store a file in several different areas of the disk, or even hundreds.
When you 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. Eventually, you wind up griping to your buddies or spouse that you need a new computer, because this one seems to have gotten so slow.
The solution: Disk Defragmenter, a program that puts together pieces of files that have become fragmented on your drive. The “defragger” also rearranges the files on your drives to make the operating system and programs load more quickly. A freshly defragged PC feels faster and more responsive than a heavily fragmented one.
Windows’ disk-defragging software runs automatically at regular intervals, in the tiny moments when you’re not actually typing or clicking. It’s like having someone take out your garbage for you whenever the can is full. Slow-PC syndrome should, therefore, be a much less frequent occurrence.
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.
And if you’re the lucky owner of a solid-state drive (SSD)—fast, quiet, super-expensive—you’ll find that fragmentation has only a minimal hit on your computer’s speed. In fact, if Windows detects that you’re using an SSD, it disables automatic defragmentation.
Even though Windows defrags your hard drive automatically in the background, you can still exert some control. For example, you can change the schedule, and you can trigger a defragmentation manually when you’re feeling like a control freak.
Start by opening the Disk Defragmenter main screen. You can get there via the Control Panel, or from the Start screen. Type disk defrag and select Settings under the search box. In the search results, click “Defragment and optimize your drives.”
Figure 21-2. Unless there’s a good reason you don’t want to schedule defragmentation, it’s a good idea to have Windows do it for you automatically—it’s like getting someone else to take out your trash.
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 Computer window—including disk partitions, flash drives, and so on.
The Disk Defragmenter window opens (Figure 21-2). From here, you can either adjust the schedule or trigger defragmentation manually:
Adjust the schedule. Click “Configure schedule.” Authenticate if necessary. A screen appears, showing that Windows ordinarily defrags your disk late every Wednesday night (at 1:00 a.m., in fact). You can use the pop-up menus here to specify a Weekly, Daily, or Monthly schedule, complete with day-of-week and time-of-day options. Click OK, and then OK again.
Manually. Click “Defragment disk”; the defragmenter does its work. Depending on the size of your hard disk, your processor speed, and the amount of fragmentation, it will take anywhere from several minutes to several hours.
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 not enough free disk space, Windows can’t do the job completely. Before you run Disk Defragmenter, use Disk Cleanup and make as much free disk space as possible.