Advanced DOS scanner. (DOS 6.2's ScanDisk utility) (Introdos) (Column)
by Tony Roberts
ScanDisk brings high-powered disk maintenance utilities to DOS.
Microsoft's DOS 6.2 includes a utility called ScanDisk, a disk repair program that anyone using a DOS-based computer should know about.
ScanDisk is similar to disk repair utilities found in packages such as The Norton Utilities and PC Tools. ScanDisk goes far beyond the capabilities of the aging Chkdsk.
Regular use of the program can help keep your hard drives error-free and working smoothly. I activate the program via the AUTOEXEC.BAT file so that it runs every time I boot up. This way, problems are corrected shortly after they occur. Left uncorrected, disk structure problems are time bombs.
Disk problems come in two varieties: logical and physical. Logical errors have to do with the way data is stord and tracked on your disk. Physicial errors result from a breakdown in the recording ability of the disk itself.
The logical erorr you're most likely to encounter is lost clusters. In most cases, lost clusters are not serious, but they do occupy disk space and should be eliminated. A lost cluster is an area on the disk that's marked as being occupied but that has no corresponding directory entry.
Lost clusters often occur as a result of a system or program crash. If a program opens a file but is unable to complete the directory entry for that file, lost clusters may result. Under normal circumstances, lost clusters do no more than occupy disk space. Occasionally, though, some programs behave erratically until the lost clusters are removed.
To avoid lost clusters, make sure to properly exit all your software--including Windows--before shutting off your computer.
When ScanDisk finds lost clusters, it gathers up the information in those clusters and saves it to a file with a CHK extension in your root directory. In most cases, this data is gobbledygook. On occasion, however, you may be able to recover some important data from a CHK file. It's usually safe to delete the CHK files unless you discover that you're missing some important data following a system crash or power failure.
Another more serious logical error is file cross-linking. Under this condition, two files lay claim to the data in a single cluster, much as two words in a crossword puzzle share the same letter. What works in puzzles, however, is disaster on a computer disk.
ScanDisk resolves the cross-linked file problem by separating the files and giving each a copy of the shared data. This is a definite improvement over Chkdsk's approach, which either truncates or deletes one or both files. Despite this more benevolent treatment, it's likely that one or both files involved in the crosslink will include data that once belonged to the other.
After a cross-link problem is corrected, examine each file for damage. If a program file is damaged, repair is next to impossible, so install a new copy from your original disks. If a text file is damaged, you should be able to salvage all but the area that was involved in the cross-link.
To identify physical errors, ScanDisk performs a surface scan. During the scan, the program makes sure that each area of the disk can be written to and read from reliably. If ScanDisk finds any weak area on the disk, it moves the data found there to be a safe location, and it marks the suspect area as bad so no program will attempt to store data there again.
ScanDisk works on hard disks, floppy disks, and DoubleSpace drives, but not on network drives or CD-ROM drives.
To run the program, type scandisk at the DOS prompt. Used without switches, ScanDisk checks out the default drive and then asks if you want to run a surface scan.
If the program encounters errors, it will ask whether you want to create an undo disk. If you agree, ScanDisk will record on a floppy disk any changes it makes.
If, for some reason, things are worse after the repair than before, you can use the undo disk to put things back the way they were and attempt another solution.
ScanDisk includes several switches that allow you to change the way it operates. For a full listing, type help scandisk at the DOS prompt. These switches allow ScanDisk to do such things as checking all available drives, automatically undertaking repairs, and skipping the surface scan. These options make it possible to configure ScanDisk to run successfully from a batch file.
Because ScanDisk checks out the structure and integrity of your disks, it needs to do its work when no other disk activity is taking place. Don't run ScanDisk while Windows, Task Swapper, or any other program that might access the disk is active.
Though once it was conventional wisdom to run Chkdsk once a day, now ScanDisk--or a similar disk repair utility--should get regular use on every system. Preventive maintenance pays off. If you don't have such a program, it's worth looking into.