NYPC Bytes!

NYPC Bytes! Home Page -- More Info -- NYPC Home Page

Why and How to
Defragment Your Hard Drive
Under Windows 95, 98, ME & XP

By Laura Balsam
Revised: March 24, 2004

In the course of troubleshooting Windows 95/98 problems, I have found that Windows is very sensitive to hard disk fragmentation. Even with gigabytes of free disk space, fragmentation can slow Windows to a crawl and cause lockups, crashes, etc.

Windows XP is less sensitive, but it still needs to be done occasionally.

This article will show you how to tell if your hard drive is fragmented. The Windows defragmentation utility in 95/98 often erroneously reports that a drive is not fragmented when, in fact, it is.

I recommend against using the Windows Task Scheduler to test and defragment your hard drive. Both SCANDISK and the Disk Defragmenter will run more quickly and reliably when Windows is not in multitasking mode. Multitasking mode is theway Windows normally runs.

I recommend performing this procedure once a month on Windows 95/98 systems, once every three months on XP. If system performance slows noticeably try a defrag. If you have less than 200 MB free on your hard drive on 95/98 you may need to do it significantly more often. Windows XP needs even more free space.

The following steps are provided in an attempt to help you. Neither NYPC nor I assume any responsibility for any problems including, but not limited to, data loss resulting from following them.

Backup your data before beginning this procedure!

Test Your Hard Drive Before Running the Defragmenter

Windows 95/98

  • Switch to DOS Mode
    • Use the mouse to press the START button on the task bar
    • Select SHUTDOWN
    • Select RESTART IN MS-DOS MODE and OK, Windows will shut down and you will see a black screen with white text or a logo
  • Run Scandisk.
    • Type in "scandisk" and press ENTER
    • When asked, perform the full surface scan
    • While the surface scan is in progress a map of your hard drive will be displayed. You need to have a large contiguous area of unused space. If you do not have enough contiguous free space, Windows will run slowly and be prone to instability. If there are a lot of partially used blocks, Windows will sometimes run more slowly. If there is almost no unused space, Windows will be extremely slow and programs will lock up a lot.
    • If the surface scan finds errors, fix them. If asked, always provide SCANDISK with the backup floppy it requests in case something goes wrong.
    • When SCANDISK is done, reboot normally

Even if a visual inspection of the hard drive map does not show the need for immediate defragmentation, the hard drive should still be defragmented monthly. It will help keep the operating system stable and peppy.

Windows XP

  • Restart in Safe Mode
    (Warning - Colors will look wierd in safe mode and everything will be bigger, it will go back to nomral when you are done.) You may have to rearrange your icons, but everything will be there.
    • Use the mouse to press the START button on the task bar
    • Select SHUTDOWN
    • Select RESTART. Windows will shut down and you will see a black screen with white text or a logo.
    • Press F8 every second or two until you see a menu
    • Select SAFE MODE and press ENTER.
  • Disable your screensaver
    • Right click on the desktop.
    • Select PROPERTIES
    • Select the SCREENSAVER tab.
    • Select None from a drop down list on the left labled Screensavers.
    • Press the Apply button and then the OK button
  • Run the hard drive checker:
    • Press the Windows Start Button
    • Double click on My Computer
    • Right click on your C drive.and select Properties
    • Click on the Tools tab.
    • In the Error Checking section click on the Check Now button.
    • Do not place checks in either checkbox:
      to automatically fix errors or scan bad sectors
    • If the hard drive checker finds one or two problems, let it fix them. If this happens often, you have a power, software or hardware problem. Do not ignore it, have it looked at.
    • When the hard disk checker finishes close it.

 

Defragment Your Hard Drive

Delete Temporary Files
Do not perform files deletions unless you are confident of your ability to safely delete and restore files from your hard drive. If you are not comfortable with this, skip this section and go directly to Reboot in Safe Mode.

When programs are installed and while they are running they create temporary files. The software is supposed to clean up after itself, but sometimes this doesn't happen. These files are placed in special directories so they can be easily located and deleted.

Cleaning out your "temp" directories will free up space on your hard drive. Do it before defragmenting, so the space can be most efficiently reclaimed.

Reboot to Safe Mode
(Warning - Colors will look wierd in safe mode and everything will be bigger, it will go back to nomral when you are done.)

Disable your screensaver

Defragment

Window 95/98

  • Right click on My Computer
  • Right click on your C drive.and select Properties
  • Click on the Tools tab.
  • In the Defragmentation Status section click on the Defragment Now button

Windows XP

  • Press the Windows Start Button
  • Double click on My Computer
  • Right click on your C drive.and select Properties
  • Click on the Tools tab.
  • In the Defragmentation section click on the Defragment Now button.
  • The defragmentor will start, click the Defragment button,

Reboot Normally, You are Done

If the hard drive is badly fragmented, defragmentation can take many hours. The longer it takes, the more improvement you will usually see. If you do this monthly, it should not take long.

On a very large or badly fragmented drive, the defragmenter will often stall at 10% for a long time while it is figuring out how to move your files.

Sometimes in WIndows, 95/98/ME, the defragmentor will lock up at a certain point on thehard drive. Give it an hour or two, if the percentage complete does not change, there may be a problem with the hard drive or the operating system. Sometimes rebooting will allow you to continue, sotimes it will not. If rebooting does not solve the problem, you may wish to try applying updates to your operating system and trying again.

Factors Affecting the Time Required to Defragment a Hard Drive

I adhere to the procedures described above and have had fewer operating system problems as a result.


Webzine Editor: nypc@hookbuilt.com

For more information about
NYPC, the New York Personal Computer User Group
see our web site http://www.nypc.org

Copyright 1999 - 2005 Laura Balsam