Home Page 3
Index Next Page
Windows9x PCs  - Routine Maintenance

What are ScanDisk & Defrag?

This is not a Technical Reference for ScanDisk and Defrag.
It just explains a few basics in enough depth for those who don't want techno-speak
but do want to understand a little more about what's happening.

Fragmentation

Hard disks are split up into thousands of small 'clusters', rather like racks of mail-sorting boxes. Files contain data, all of which will not fit neatly into single clusters on hard disks, floppies or other types of drive. So they are split across as many as necessary, their exact locations recorded by the File Allocation Table (FAT). This is rather like "Letters for J Smith" being put into a variety of numbered pigeon-holes, and a record being kept of which ones.

A new file will initially be spread tidily over adjacent clusters. As files get opened, used, altered, saved and so on, they become fragmented, divided up and the parts (clusters) placed in the handiest free 'slots'. This is inefficient, as a program wanting a file has to collect the parts together from wherever they are, possibly in widely spaced locations.

The idea of Defragmenting is to sort all these parts of files so that they are contiguous (ie kept together in sequence) wherever possible. That speeds up disk searching when they are wanted.

ScanDisk - To Fix or Not To Fix

The suggested settings are my recommendations. Other users may disagree, and want ScanDisk to offer choices on finding errors. Having ScanDisk fix all errors is the simplest choice for new and non-technical users, but may not always be the safest. For example, ScanDisk may decide to shorten some Long File Names as being "too long". This could result in some programs being unable to run or open such files.

I suggest that ScanDisk be told to delete 'lost fragments' and 'cross-links' because the chances of retrieving data from them if they are saved is remote. Most users cannot tell what such saved files contain - they may be parts of program files or other files in a format which nothing the average user has can use to read, identify and restore.

If you are curious don't check "Automatically Fix Errors". ScanDisk will ask what you want done if it finds them; you can them tell it to fix them anyway, but will know what sort of errors are cropping up. Any errors found will be noted in the file 'C:\Scandisk.log', a text file which Notepad is automatically assigned to open on most setups. If ScanDisk reports that it is finding a lot of such errors, it is probable that the system is cracking up and due for a re-install anyway!

Doing It In DOS

You can - as mentioned on Page 4a (Troubleshooting) - run Scandisk from a DOS prompt (not the 'MS-DOS Prompt' on the Windows Start Menu). Defragmenting, however, can only be done from within Windows, so if you used to do it with DOS 6 or earlier and Windows 3x, forget it! The reason is that ScanDisk has to be able to run in DOS mode (on re-booting following a system crash) so has been upgraded to work with Long File Names and the rest of the 32-bit Win9x operating environment, while Defrag doesn't, so has been jettisoned from the Win9x remnants of DOS.

If you plan to use ScanDisk in DOS mode, please see the ScanDisk section in DOS for Windows9x, which explains how to get at the settings in "scandisk.ini"

Using Different Drives

Using more than one physical Hard Drive or Partitioning a large hard disk into two or three smaller drives (partitions) helps with system maintenance. Keeping user-created data files separate from program files reduces the risk of extreme fragmentation, as well as making Backing Up simpler.

Floppy drives used for backups should also be scanned for errors and defragmented periodically, as should Zip, Jaz and Superdrives etc. They should certainly be part of a maintenance routine if used as removable working drives (eg: floppies swapped between laptops and desktop PCs, or drives used to hold personal data and removed for security when not in use).

The time taken to Scan and Defrag drives which don't hold the main bulk of system / program files is usually much less than for a drive which does. Assuming checking is done regularly, it may take 15 minutes or less to process 'Data' drives, and another 15 or 30 to check the main 'system' drive (usually C: ). This is faster than defragmenting a single hard drive with everything on it. Of course, if you do a lot of work with large file formats - sound, pictures etc - or big databases Defrag will take correspondingly longer. The same happens after large backup Zip files have been updated.

FAT32

From Windows 95b onwards it has been possible to format a drive as FAT32 rather than the default FAT16 (or simply 'FAT'). This is usually done to reduce the amount of wasted space, by making the clusters containing data smaller; files may take up only part of a cluster, the rest being left empty but 'reserved'. Reducing the cluster size reduces the amount of this 'reserved' empty space.

The significance of this for Defragmenting is that there are a great many more clusters containing parts of files to be moved around. So it takes longer while Defrag shuffles them to and fro to get related ones together. A badly defragmented FAT32-formatted disk can thus take ages to sort into the best order; the same degree of defragmentation under FAT16 would take rather less time to tidy up, but there would be more wasted space.


A FAT32 cluster is 4kB. The significance of dropping from FAT16's minimum 16kB to a FAT32 4kB cluster size can be imagined quite easily.
An average Text file might be 1kB, say. Under FAT32 it therefore occupies 1kB of a 4kB cluster and reserves the remaining 3kB. Under FAT16 it would have reserved 15kB of empty space. A 19kB document would occupy 5 x 4kB FAT32 clusters, with 1kB empty, but under FAT16 would take up 2 x 16kB clusters, with the second cluster wasting 13kB!
This is not too important in a folder with lots of large files, but if you open Explorer and look at the C:\Windows folder, you'll see there are many smallish files there alone. Overall, therefore, FAT32 makes a considerable saving in space.

Free Spaces

Defrag does not - even if set to "Full defragmentation" - take apart the entire drive it is looking at and re-sort the lot unless it is badly defragmented with a lot of empty spaces. It works out where the clusters belonging to individual files are, and aims to get them contiguous (ie together). It also aims to get the most-used files towards the 'front' of the drive, as that speeds up system working.

Defrag in Windows98 goes further than in Windows95 by noting the most frequently opened programs and assigning them to disk sectors which are accessed fastest.   (See Page 2a).

Where Defrag finds that significantly large blocks of clusters together have been deleted, it will take advantage of such chunks of free space in the middle to shift things around to a better order than if there were only a few odd clusters free in which to manoeuvre. So deleting unwanted files (as suggested on Page 1) gives Defrag the opportunity to do a fuller re-sort ending up with a more efficient drive, though it will probably take longer to complete.

Do not worry if Defrag "sticks" at around the 80 to 95% mark. It can take an irritatingly long time to finish sorting the same large block towards the end. And if you have 'View Details' open and see it defragmenting backwards a few clusters at a time, it is probably going to be a long session!

Top   ~  Index Page   ~  Win98   ~  Win95   ~  Next page

< Home >


BobMoCo