7 Ways to Defragment a Disk on a Windows Computer

Table of contents:

7 Ways to Defragment a Disk on a Windows Computer
7 Ways to Defragment a Disk on a Windows Computer
Anonim

When your computer writes data to a file on your hard drive, it doesn't always have a chance to put all the data together. One section of the file could be written near the beginning of the disc, and the rest could be written elsewhere. This causes programs to slow down, because the computer wastes time in retrieving all sections of the file from different places on the disk.

Defragmenting your hard drive allows you to arrange files (and free space) neatly, reducing the time it takes to read a file. There are various tools available to defrag your computer, and one version is included with Windows. Here are some methods to perform the defragmentation process on your Windows computer.

Steps

Defragment a Disk on a Windows Computer Step 1
Defragment a Disk on a Windows Computer Step 1

Step 1. Take note of the things you don't have to do

Some older tips may still resonate in your mind as you prepare for defragmentation; the list shows what you don't need to worry about:

  • It was recommended to open Windows in "Safe Mode". It's not necessary any more.
  • You don't need to uninstall programs you don't use or need. In general though, it's always a good idea to remove what you don't need.
  • You don't have to close all unnecessary programs or delete all programs that are expected to run.
  • You don't need to delete temporary files.
Defragment a Disk on a Windows Computer Step 2
Defragment a Disk on a Windows Computer Step 2

Step 2. If Windows advises you to defragment the disk, follow its instructions and click on "Defragment Disk"

Easy!

Method 1 of 7: Details for Windows

Defragment a Disk on a Windows Computer Step 3
Defragment a Disk on a Windows Computer Step 3

Step 1. Note that different versions of Windows show different levels of detail on disk usage

This table indicates the meaning of each colored area: {| class = "wikitable" | - | Style = "background: blue" | xxx | Style = "background: azure; color: black" | The BLUE areas are the sections where files and folders are contiguous and adjacent. | - | Style = "background: white" || Style = "background: azure; color: black" | The WHITE areas are unused. | - | Style = "background: red" || Style = "background: azure; color: black" | The RED areas contain parts of files that need to be collected and moved to a location with enough unused space so that the resulting files are consolidated. |}

Method 2 of 7: Windows 7

Defragment a Disk on a Windows Computer Step 4
Defragment a Disk on a Windows Computer Step 4

Step 1. Note that the Windows 7 Defragmentation feature runs automatically, but if you want to check it manually, please follow the steps below

Defragment a Disk on a Windows Computer Step 5
Defragment a Disk on a Windows Computer Step 5

Step 2. Open the Control Panel

Defragment a Disk on a Windows Computer Step 6
Defragment a Disk on a Windows Computer Step 6

Step 3. Open "System and Security"

Defragment a Disk on a Windows Computer Step 7
Defragment a Disk on a Windows Computer Step 7

Step 4. Click on "Defragment your Hard Drive"

Defragment a Disk on a Windows Computer Step 8
Defragment a Disk on a Windows Computer Step 8

Step 5. Select a disk to scan

For example the "C:" drive.

Defragment a Disk on a Windows Computer Step 9
Defragment a Disk on a Windows Computer Step 9

Step 6. Click on "Scan Disk"

  • Note that the time required for defragmentation depends on the size of the disk and the level of the amount of fragments (red areas).
  • Even if you can continue working while the defrag tool is running, the system response will often be very slow. Consider starting a defragmentation before bedtime.
  • If you need to work after the defrag has started and you can't bear the poor performance, pause or stop the process. If you stop it, the files you defragmented will remain consolidated. The advantage of the function pause is that the instrument picks up where it left off.
Defragment a Disk on a Windows Computer Step 10
Defragment a Disk on a Windows Computer Step 10

Step 7. Change the defragmentation schedule as follows

If you want to set a day of the week on which to defragment, follow the steps below:

  • Click on "Configure Schedule".
  • Open the days menu.
  • Select "Day (ex: Saturday)".
  • Click on "OK".
  • Click on "Close".

Method 3 of 7: Other Windows Systems

Defragment a Disk on a Windows Computer Step 11
Defragment a Disk on a Windows Computer Step 11

Step 1. View the volumes in "Computer"

Right click on the disk to defrag, for example, "C:".

Defragment a Disk on a Windows Computer Step 12
Defragment a Disk on a Windows Computer Step 12

Step 2. Click on the "Tools" tab

Defragment a Disk on a Windows Computer Step 13
Defragment a Disk on a Windows Computer Step 13

Step 3. Click on "Defragment"

Method 4 of 7: Run Defragmentation Again

Defragment a Disk on a Windows Computer Step 14
Defragment a Disk on a Windows Computer Step 14

Step 1. Consider running it again

Running the defragmentation process again on the same volume can be helpful, because the first run should have consolidated the free space on the disk. A second will allow you to move files that weren't moved the first time.

Defragment a Disk on a Windows Computer Step 15
Defragment a Disk on a Windows Computer Step 15

Step 2. Check the reports

When defragmentation is complete, view the report. The important thing to check is the files with many fragments (more than 20) "you use". It won't do much to defrag the ones you never access!

Defragment a Disk on a Windows Computer Step 16
Defragment a Disk on a Windows Computer Step 16

Step 3. Defragment individual files

If your reports show a file with many fragments (which you use often), there is a free tool that can contiguously render a single file, available at https://technet.microsoft.com/en-us/sysinternals/bb897428.aspx. It is a command prompt tool that can be run with the "Run" program which you can find in the "Start" menu.

Method 5 of 7: From the Command Line

Defragment a Disk on a Windows Computer Step 17
Defragment a Disk on a Windows Computer Step 17

Step 1. Run the Disk Defragmenter

Defragment a Disk on a Windows Computer Step 18
Defragment a Disk on a Windows Computer Step 18

Step 2. Go to "Start", then "Run"

Enter "dfrg.msc" in the window. Alternatively, you can run it by going to "Start", "Programs" (or "All Programs"), "Accessories", "System Tools", "Disk Defragmenter"..

Defragment a Disk on a Windows Computer Step 19
Defragment a Disk on a Windows Computer Step 19

Step 3. Click on "Analyze", in order to evaluate the extent of the fragmentations, and then observe the report

If you want to continue: make sure the selected disk is the right one (C: is the default disk), and click on the "Defragment" button.

Defragment a Disk on a Windows Computer Step 20
Defragment a Disk on a Windows Computer Step 20

Step 4. Wait until the process is complete

Sit back and relax as your computer tidies up the fragmented files.

Method 6 of 7: Batch method

Some people prefer to read pages full of information instead of colorful graphics. If that's your case, use this method.

Defragment a Disk on a Windows Computer Step 21
Defragment a Disk on a Windows Computer Step 21

Step 1. Create a new.txt file

In Windows you will open the file with Notepad by default.

Defragment a Disk on a Windows Computer Step 22
Defragment a Disk on a Windows Computer Step 22

Step 2. Enter the code

  • Type "defrag".
  • Enter the drive letter you want to defragment. For example: "defrag c:".
  • Enter the "-v" parameter if you want to display additional data.
  • Enter "-a" if you want standard data only. Note:

    -a -v

  • will allow you to get all the available data.
Defragment a Disk on a Windows Computer Step 23
Defragment a Disk on a Windows Computer Step 23

Step 3. Run the file

Rename your file as

.bat

. Your file is now a batch file. Now, double click on it.

Defragment a Disk on a Windows Computer Step 24
Defragment a Disk on a Windows Computer Step 24

Step 4. Wait

It can take anywhere from ten minutes to several hours to defragment a disk, depending on the size, number of files and amount of fragmented files.

Method 7 of 7: Apple Mac OS X

Step 1. Relax, you don't have to worry

The OS X BSD system defragments files automatically, so no defragmentation process is required. The HPFS + file system starts the process when a fragmented file is read. The file is rewritten to a different place on the disk.

Advice

  • Group files into different volumes, keeping your data on a different disk. Is very important. One of the biggest problems with fragmentation is caused by browsers, which continually write and delete files. Keeping your browser cache on a separate volume prevents it from affecting other files as well.
  • Remember that defragmentation takes files written to different places on the disk and rearranges them, to allow the system to run more efficiently. Some files (such as system files and files needed for startup) cannot be moved.
  • The tool that comes with the operating system works quite well. However, it does not prioritize defragmenting files according to usage. Commercially available programs for defragmentation claim to be more effective.
  • Defrag your drive overnight. If you have never defragmented a disk, or have written a lot of new files since the last run, the process will take several hours.
  • The more often you run defragmentation, the faster the process will be.
  • On very old Windows computers, if the Defrag tool keeps restarting, try running the defragmentation in safe mode.
  • Most Linux file systems are designed to minimize fragmentation and don't need to be defragmented that often.

Recommended: