click here for Defragmenting - Windows 2000 - XP
Scandisk and Defrag are important utilities that come with Windows, to help you tune up your Windows filesystem and make sure it's running properly. Scandisk checks your drive to make sure there aren't any problems with it, and Defrag (short for Disk Defragmenter) organizes your filesystem to help Windows read files faster.
You can usually find Scandisk and Defrag on your Start menu under "Programs" then "Accessories" and "System Tools". Another easy way to access both programs is to open "My Computer", and right-click on the drive you want to tune up. On the context menu choose "Properties" and then select the "Tools" tab. If you use this second method to start Scandisk and Defrag, you should see a window like this:
As you can see, this window tells you how long it's been since you last ran Scandisk or Defrag on this drive. If you see a message like "Windows was unable to determine when you last checked this drive for errors", or "Windows was unable to determine when you last defragmented this drive", then you probably haven't done it since Windows was installed.
Just like you periodically get your oil changed in your car, you should run Scandisk and Defrag now and then, to keep everything running smoothly. You should run Scandisk and Defrag at least once a month.
It should be noted that running Scandisk and Defrag more than once a month is still helpful. Also, the more often you run Defrag, the less time it will take, because there is less work to do.
When you first start Scandisk, you should be greeted by a window similar to this:
At the top you will find a box that lets you select which drives you would
like to check for errors. If you want to have Scandisk check multiple drives,
you can hold down the Ctrl key while selecting them. Usually you will just
select the one drive you are interested in.
Moving downwards, there are two radio buttons, called Standard and Thorough. A standard test completes fairly quickly, but only checks the FAT tables and directory entries. The Thorough test can take a long time, but performs a test on each sector of a drive.
Any errors that are not due to a failure of the hardware can be detected with a Standard scandisk. On the other hand, if you suspect the hardware is having problems, or sectors on the drive are going bad, choose the Thorough option.
The checkbox near the bottom named "Automatically fix errors" is controls the behavior of Scandisk when a problem is found. If you leave this box unchecked, Scandisk will stop and ask you what course of action to take, for each error it finds. Scandisk's default actions are pretty safe, so it's okay to leave this checked.
The image to the left shows the dialogue box presented after clicking the Advanced button. The default settings are shown here, and there is little reason to change them.
Most of the settings are self-explanatory. "Check host drive first" applies only to compressed drives. A compressed drive must be contained within an uncompressed drive, and checking this option tells Scandisk the uncompressed
drive first. Having a compressed drive is not recommend.
The image to the right shows the Scandisk results window. "KB total disk space" is the usable size of your disk, left over after the FAT filesystem overhead. "KB available on disk" is the total free space left. "Bytes in each allocation unit" is the cluster size of this filesystem. "Allocation units on disk" and "available allocation units" are the same as "KB total disk space" and "KB available on disk", respectively, except expressed in units of clusters instead of kilobytes. To convert from clusters to kilobytes, you can multiply by the "bytes in each allocation unit" field, then divide by 1024.
"Bytes in bad sectors" shows the number of bytes used up by clusters that have been marked bad (unusable). A small number of bytes in bad sectors (less than 100000) is normal, as is finding a new one now and then. On the other hand, if your drive regularly finds new bad sectors, it is probably time to think about replacing the drive.
The other fields are self-explanatory, and just show the number of bytes taken up by different types of files on your system.
After starting Defrag, you will see a window similar to this, asking which
drive you would like to defragment. Like Scandisk, there is a way to select
multiple drives simultaneously, jest click on the little down arrow and select
all drives. this option only appears if you have more than 1 physical drive. In Windows 98, the defragmentation process will
start as soon as you hit the `OK' button, so the `Settings' button is also on
this window.
To the right is the main Defrag window. Under Windows 95, you will usually
just click the `Start' button. Under Windows 98, Defrag will automatically start
working, so there is no need. The `Advanced' button here takes you to Defrag's
settings.
After Defrag has started working, it will display a percentage bar showing how much of the drive has been defragmented already. At this time you can click the `Show Details' button if you wish to watch Defrag moving the blocks of data around your drive. It isn't a very useful option, but it can be fun to watch, especially if you're bored waiting for your Defrag to finish. If you have a slower computer, using this option may slow Defrag down noticeably, but anything faster than a Pentium 166 with a decent video card won't experience a significant slowdown.
On the left you can see a screenshot of Defrag in action, when Show Details mode is on. Hitting the Legend button will show a chart detailing what the different colored blocks mean. The Pause button will halt Defrag temporarily, and Stop will cancel your defragmentation.
Here is a screenshot of the Defrag settings under Windows 95. The default options are shown here. There are 3 choices for the Defragmentation Method. The first is `Full', which is the best choice. It moves files so that they occupy continuous ranges of clusters, and Windows can read them faster. It also tries to make the space not used up by files into one large block. The second choice is `Files only'. With this option you will get the benefits of defragmenting the filesystem, but since the free space may still be scattered around the disk, new information written to the disk will more easily become fragmented again. The third option, `Free space only', doesn't optimize any of your current files, but will help make sure new ones do not fragment.
You should leave the "Check drive for errors" option checked. It doesn't take much time to do a quick check of your drive before the Defrag, and you risk losing data if you try to defragment a corrupted filesystem.
The Windows 98 Defrag has fewer settings. Again there is an option to check the drive for errors, and one to tell Windows to rearrange your files so that they load quicker. I don't know of any downside to that option, and it does improve performance, so leave it checked.

When Defrag is done, it will present you with this window. Just hit `Yes' unless you want to defragment another drive.
Both Scandisk and Defrag allow you to continue working with your computer while they run. Since they need to manipulate the drive at a low level, they will restart to re-read the filesystem information when a drive they are working with is written to. This can especially pose a problem when the Windows swap file used for virtual memory is on that drive. Windows may read and write the swap file even though you are not saving any files to that drive.

The dialogue box to the left shows a warning you may receive after Scandisk was forced to restart 10 times. If you want Scandisk to finish faster, it's probably a good idea not to continue running other programs during the scan. You may even want to quit some programs, or do a full reboot before you scan.
By pressing NO, scandisk will continue to run without bothering you again about restarting.
A common problem is screensavers that trigger during a Scandisk or Defrag. An easy way to prevent this is to click on the Start menu, but leave it open. Windows will not trigger your screensaver while the Start menu is displayed.
If you still have constant problems with Scandisk and Defrag restarting, try the following steps: