How to Defragment a Disk on a Windows Computer






Defragment a Disk on a Windows Computer

When your computer writes data into a file on your hard drive, it's not always able to place all of the data together. A section of a file might be written near the beginning of the disc, the rest of that file could be written near the end. This causes programs to run slowly, as the computer spends time retrieving the file fragments from all over the disk.
Defragmenting your disk volume arranges files (and free space) in an orderly manner, reducing the time taken to read a file.[1] There are various tools available to defragment the computer, and one version is included with MS Windows. Here are some methods for defragmenting your Windows computer.

Steps

  1. 1
    Note things that you don't need to do. Some older advice may still be in your mind when you set out to defragment; this list shows what you don't need to be concerned about:

    Hush Technologies

     fanless and silent computer low energy, fast computing
    www.hushtechnologies.net
    • It used to be recommended to open Windows in "Safe Mode". This is not necessary now.
    • It's not necessary to remove programs you don't use or need. However, as a general housekeeping rule, it's always a good idea to discard what you don't use.
    • You don't need to close all unnecessary programs or cancel any programs scheduled to run.
    • You don't need to delete any temporary files.
  2. 2
    If Windows recommends that you defragment your drive, simply follow its prompt and click on "Defragment Disk". Easy!

Windows details

  1. 1
    Note that different versions of MS Windows display different levels of detail of the before and after usage of the volume. This table sets out the meanings of the colored areas:



xxx  BLUE areas are sections where the files and directories are contiguous and adjacent.
  WHITE areas are unused.
  RED areas contain pieces (fragments) of files which need to be collected and placed in a location with enough unused space so the resultant file is in one (or as few as possible) pieces.


Windows 7

  1. 1
    Note that Windows 7's Defragment feature runs automatically but if you want to control it manually, follow the next steps.
  2. 2
    Open the Control Panel.
  3. 3
    Open "System and Security".
  4. 4
    Click on "Defragment Your Hard Drive".
  5. 5
    Select a drive to analyze. For example, the "C:" drive.
  6. 6
    Click "Analyze Disk".
    • Note that the time it takes to do the defragmentation is dependent on the size of the volume and the amount of fragmentation (red).
    • While you can continue working while the defragmentation tool is running, the system response will often be very slow. Consider starting up a defrag before you retire for the evening and letting it run overnight.
    • If you need to do work once the defragmentation has begun and you cannot tolerate the poor performance, pause or stop the defragmentation tool. If you stop files that have been defragmented as still consolidated. The advantage of pause is that the tool will continue where it left off when it resumes.
  7. 7
    Change the defragmentation schedule as follows. If you want to control the day of the week used for defragmentation, do the following:
    • Click "Configure Schedule".
    • Open the day menu.
    • Select "Day (e.g., Sunday)".
    • Click "OK".
    • Click "Close".

Other Windows

  1. 1
    Display volumes in "My Computer". Right click on the drive to defrag, for example, "C:".
  2. 2
    Click on the "Tools" tab.
  3. 3
    Click on "Defragment".

Running again

  1. 1
    Disk Defragmenter with two hard drives.
     Disk Defragmenter with two hard drives.
    Consider running again. Re-running the defragmentation tool a second time on the same volume can be helpful as the first run should have resulted in unused space being left in larger chunks than prior to defragging. Running again permits file fragments that were unable to be collected and placed contiguously during the first run to be optimized in the next run.
  2. 2
    Check the report. After the tool completes, display the report. The important thing to check are files with many (more than 20) fragments that you use. It doesn't help to defragment files that you never access!
  3. 3
    Defragment individual files. If the report shows a file with many fragments (that you use), there is a free tool to make a single file (or files that match a pattern) contiguous, available athttp://technet.microsoft.com/en-us/sysinternals/bb897428.aspx. This is a command line utility started from the "Run" or "Command Line" button of the "Start" menu.

From the command line

  1. 1
    Run the Disk Defragmenter Program.
  2. 2
    Go to "Start", then "Run". Enter "dfrg.msc" in the window. Alternatively, launch it by going to "Start", "Programs" (or "All Programs"), "Accessories", "System Tools", "Disk Defragmenter". A window similar to the one on the right should appear.
  3. 3
    Click "Analyze" so you can see what the damage is, and then look at the report. If you want to continue: Make sure that your desired drive is selected ("C:" being the default drive), and click on the Defragment button.
  4. 4
    Wait until the process is complete. Sit back and relax as your computer organizes your fragmented files.

Batch Method

Although using batch files to defrag your computer, some accually prefer to see words filled with info than something filled with color.
  1. 1
    Make a new txt application. On windows you will edit the txt document with Notepad on default.
  2. 2
    Make the code.
    • Type in defrag because you are obviously going to defrag a disk.
    • Type in the drive letter or mount point that you wish to defragment. For example: defrag c:.
    • Type in parameter -v if you want to see extra data.
    • Type in -a if you just want the data. Note: -a -v will print out a more detailed data.
  3. 3
    Execute the file. Rename your file so that the extension is .bat. Your file is now a batch file. Next, click on it.
  4. 4
    Wait. It could take anywhere from ten minutes to several hours to defragment a hard disk, depending on the size of the disk, number of files, and how many files are fragmented.

෴Chamara'sBlog෴