Defragmenting a Hard Drive

by Barry Dysert
(last updated November 10, 2014)

Bob started to notice that, as of late, his system has gotten a bit sluggish. He mentioned it to a friend, and she said that he should check into defragmenting his hard drive. While she explained a little bit about what this means, they ran out of time before she could tell him how to actually defragment. Bob is wondering how to go about defragmenting his hard drive.

Defragmenting a disk can be an effective way to improve your system's performance—at least for mechanical drives. Windows does not defragment solid-state drives, as doing so can accelerate them wearing out.

Through the normal course of use, the performance of mechanical disks can degrade from having lots of contiguous space to having that space split into pieces that the operating system must keep track of every time it needs to access a file. Defragmenting a disk essentially groups files and pieces of files into contiguous space again so that disk access is improved.

By default, automatic disk defragmentation is turned on in Windows so that you usually don't have to concern yourself with it. It is possible in Bob's case that automatic defragmentation is turned off, or he wouldn't have noticed a progressive sluggishness to his system. If you wish to change the defragmentation schedule, want to perform a manual defragmentation, or otherwise are just curious about the condition of your disks, you can launch the defragmenter and investigate.

There are several different ways you can start the disk defragmenter tool that is provided with Windows; all of them lead to the same point. Here are the methods to start the defragmenter in Windows 7:

  • Click Start | Computer and then right-click on the drive you want to defragment. In the resulting Context menu, click Properties to display the drive's Properties dialog box. Display the Tools tab and click Defragment Now.
  • Click Start | All Programs | Accessories | System Tools | Disk Defragmenter.
  • Click Start | Control Panel | System and Security. Under the Administrative Tools category, click Defragment Your Hard Drive.

If you are using Windows 8, start the Control Panel (use any of the common ways of doing this), then click System and Security. Scroll down, and under the Administrative Tools category you'll see a link to Defragment and Optimize Your Drives.

Once the defragmenter is running, you'll see its window. The appearance of the window differs a bit depending on your version of Windows. Here's how the window looks in Windows 7: (See Figure 1.)

Figure 1. The Disk Defragmenter window.

If you are using Windows 8, the Optimize Drives window looks like this: (See Figure 2.)

Figure 2. The Optimize Drives window.

The information displayed in the Disk Defragmenter or Optimize Drives window on your system will necessarily be different than what you see in these examples. You can tell a few things from this information:

  • When automatic defragmentation is set up to run. (In the Windows 7 example it is set to run every Wednesday at 1:00 a.m. In the Windows 8 example it is set to run weekly, but a day and time is not indicated.)
  • When defragmentation will next run. (Only in Windows 7.)
  • What the current fragmentation status is of your disk drives.

If you want to change the defragment schedule, click the Configure Schedule button in Windows 7 or the Change Settings button in Windows 8. Windows 7 displays the Modify Schedule dialog box. (See Figure 3.)

Figure 3. The Disk Defragmenter scheduling window.

In Windows 8 you'll see a very similar dialog box, the only difference being that you cannot specify a day and time for the schedule. The dialog boxes allow you to turn off automatic defragmentation (which is not recommended), change how often the defragmenter runs, when it runs (again, only in Windows 7), and what disks it runs on. If you change any of the settings, click OK to return to the previous window.

In the Disk Defragmenter or Optimize Drives dialog box you can analyze the current state of each of your disk drives by selecting the disk to be analyzed and clicking the Analyze Disk button (Windows 7) or the Analyze button (Windows 8). When you do, the information in the dialog box is updated to show that an analysis is underway. After a few minutes, the analysis completes and you may see a change in the "% fragmented" value for that disk. Assuming you're doing defragmentation regularly, the change probably won't be big, but you nevertheless have the opportunity to manually do a defragmentation pass on it immediately. This is done by clicking the Defragment Disk button (Windows 7) or the Optimize button (Windows 8).

Manually performing a defragmentation causes a re-analysis of the disk, and then the actual defragmentation process begins. You are continually updated on the progress of the process, and after a while (depending upon how much work there was to do) the process will end, and your disk will once again be defragmented.

Incidentally, if at any time (whether you're doing an analysis or an actual defragmentation) you want to stop the process, you can safely click the Stop Operation button without fear of data corruption.

 This tip (12144) applies to Windows 7 and 8.

Author Bio

Barry Dysert

Barry has been a computer professional for over 30 years, working in different positions such as technical team leader, project manager, and software developer.  He is currently a senior software engineer with an emphasis on developing custom applications under Microsoft Windows. ...

MORE FROM BARRY

Changing a Folder's Icon

Changing a folder's icon is one way to make Windows a bit more personal. This tip describes how to do that.

Discover More

Creating a System Image

A system image is a snapshot of your system disk as of a certain point in time. Should the need arise, you can restore your ...

Discover More

Filtering Event Logs

Filtering a log in the Event Viewer allows you quick access to those events you're interested in watching over time. This tip ...

Discover More
More WindowsTips

Stopping Windows from Creating Thumbs.db Files

Many times, the automatically created Thumbs.db file is more trouble than it's worth. If you want to stop Windows from ...

Discover More

Displaying Details about an Audio File

Audio files have additional attributes that other files don't have. This tip describes how you can display these additional ...

Discover More

Removing a File Type Program Association

Removing a file type program association is a task for third-party utilities. You can, however, change the association ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven more than 5?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.