How to Defrag a Computer: Step-by-step Instructions

By: Zach Taras  | 
Before you blame lag, see if you need to defrag to get back to your optimal gaming experience. Alistair Berg / Getty Images

Modern computers have impressive processing speeds, but over time, even the fastest machines begin to slow down somewhat. If your desktop or laptop's performance is declining, even during light browsing, it could be time for a defragmentation (defrag for short).

If that phrase gives you pause, don't worry: You're about to learn about the defragmentation process and how to defrag a computer.

Advertisement

Defragmentation: Good For What Ails Your Disk

The word "defrag" is typically used to refer to the Microsoft Windows utility called Disk Defragmenter. It is designed to solve a problem that occurs because of the way hard disks store data.

Initially, what is loaded onto your computer hard drive (in terms of programs, files, and so forth) is encoded onto the hard disk in an orderly fashion. But over time, the drives become far more complexly organized, and fragmented data is stored all over the place.

Advertisement

Hard Disk Drives: An Overview

Here are three key facts about hard disks:

  1. Hard disk drives (HDD) store data in chunks called sectors. If you imagine the surface of the disk divided into rings (like the rings of a tree), and then imagine dividing each ring into pie-slices, a sector is one pie-slice on one ring. Each sector holds a fixed amount of data, like 512 bytes.
  2. The hard disk has a small arm that can move from ring to ring on the surface of the disk. To reach a particular sector, the hard disk moves the arm to the right ring and waits for the sector to spin into position.
  3. Hard disks are slow in computer terms. Compared to the speed of the processor and its memory, the time it takes for the arm to move and for a sector to spin into place is an eon.

Because of fact No. 3, you want to minimize arm movement as much as possible, and you want data stored in sequential segments on the disk.

Advertisement

Storing Data on a Hard Disk Drive

So let's imagine that you install a new application onto an empty hard drive. Because the disk is empty, the computer can store the files of the application into sequential sectors on sequential rings. This is an efficient way to place data on a hard disk.

As you use a disk, however, this efficient technique becomes harder for a disk. What happens is that the disk fills up. Then you erase files to reclaim space. These files that you delete are scattered all over the surface of the disk.

Advertisement

When you load a new application or a large file onto the disk, it ends up being stored in hundreds or thousands of these scattered pockets of space. Now when the computer tries to load the scattered pieces, the disk's arm has to move all over the surface and it takes forever.

How the Defragmentation Process Works

The idea behind the disk defragmenter is to reorganize the file system so that every file is stored on sequential sectors on sequential rings of the disk. In addition, a good disk defragmenter may also try to optimize things even more, for example by placing all applications "close" to the operating system on the disk to minimize movement when an application loads.

When done well on older disks, defragmenting can significantly increase the speed of file loading. On a new disk that has never filled up or had any significant number of file deletions, it will have almost no effect because everything is stored sequentially already.

Advertisement

As you might imagine, the process of individually picking up and moving thousands of files on a relatively slow hard disk is not a quick process; it normally takes hours.

Using the Disk Defragmenter in Windows 7

Ever since the release of the Windows 7 operating system, the disk defragmenter runs automatically. That means that you don't have to do anything, and the defragmentation process will occur periodically. This is certainly convenient, but sometimes, you might want to manually defrag the disk.

If you're experiencing performance issues in Windows, you have a couple of options when it comes to using the disk defragmenter. You can update the schedule on which it runs by doing the following.

Advertisement

  1. To open the disk defragmenter, click on the Start menu at the bottom left corner of your screen.
  2. Here, you can either input "disk defragmenter" or "defrag" into the search bar, or select Control Panel.
  3. Once you're at the Control Panel, click on System and Security.
  4. Next, under the Administrative Tools tab, click Defragment Your Hard Drive.
  5. Click Configure Schedule. This allows you to pick a specific time for the disk defragmenter to run.
  6. Confirm your choice by clicking OK.

If you want to run defrag right away, these are the steps to follow.

  1. Click on the Start button.
  2. Type "defragment" or "defrag" into the search bar.
  3. From the Current Status column, select the disk you want to defrag.
  4. Click Analyze Disk. You might need to enter your administrator password.
  5. This will allow the computer to determine if the disk defragmenter needs to be run. You'll get a result, calculated as a percentage, of the disk's fragmentation level. Anything over 10 percent means you should run a defrag.
  6. Click Defragment Disk. Then, sit back and let the disk defragmenter do its thing.

Advertisement

Using the Disk Defragmenter in Windows 8 to 10

If you're using the more recent versions of Windows, you will still have the benefit of a disk defragmenter that will run automatically. However, you can also run a manual defrag on the disk if you want to.

Follow these steps if your PC's performance is lagging, and you think fragmented data might be the culprit.

Advertisement

  1. On the search bar, type defragment or defrag.
  2. Select Defragment and Optimize Drives from the available options.
  3. Select Optimize Drives and click Optimize.
  4. That's all you need to do. As the disk defragmenter runs, try to use your computer lightly, or not at all. The process can take a few hours.

As you can see, the later versions of Windows don't require you to select disk defragmenter or even click "Defragment Disk" in order to get the process to run. Instead, the "Optimize Drives" option is used as a way to manually defrag the disk.

Advertisement

Do SSDs Need to Be Defragmented?

With the advent of SSD (solid state drive) technology, the need for a defragmentation process has been significantly reduced. Unlike mechanical hard disk drives, SSDs have no moving parts, and the data is stored and modified using chips.

Because of the different, more efficient way that a solid state hard drive operates, the SSDs do not need to be defragmented the way that a hard disk drive does. In fact, defragging can potentially shorten their life span.

Advertisement

Luckily, the operating system on your computer will recognize this, and it won't perform a disk defrag if you have an SSD.

Frequently Answered Questions

What does disk defragmentation do?
Disk defragmentation organizes files on your computer so that they can be read and written more efficiently. When you defragment your disk, the system rearranges files so they are stored in contiguous blocks rather than scattered locations. This can improve performance because the system can quickly read and write files.
Is it good to do disk defragmentation?
Yes, it is good to do disk defragmentation because it can help improve the performance of your computer. The exception is with SSD (solid state drive) technology; defragging can potentially shorten the lifespan of SSDs.
What are some ways to improve the performance of my PC?
Besides running the disk defragmenter, you can also delete unnecessary files from your hard drive. In Windows 10 and 11, you can use the Disk Cleanup utility to help with this task.

Advertisement

Loading...