Classic Computer Magazine Archive START VOL. 3 NO. 3 / OCTOBER 1988

ON DISK!

Small Tools

Dave's Handy-Dandy Disk Certifier

by Dave Small with Dan Moore


Certify disk sectors lost from magnetism or mayonnaise with CERTIFY.ARC on your START disk.

No preamble--this month in "Small Tools," we're going to look at a simple little program that lets you make sure nothing nasty has happened to your ST floppy disks. Let's get started!

Floppy Disk Certifier

This program isn't particularly clever, just mighty useful. It reads an entire disk in, checking to make sure that none of the sectors on it have gone bad. It's an easy way for you to check disks and make sure they're still physically okay at the track/sector level.

There are several things that can go wrong on a disk. There's the ever popular damage to the directory, which happens a lot on the ST because of the 40 folder bug--very common on hard disk systems. (This is a bug in the ST's operating system that causes your disk directories to go haywire any time you access more than 40 folders in a single session.) There's nothing we can do about that one in this article. But there's also the very trendy sector damage, where the magnetic fields on your disk go bad in one spot and make a sector go bad; this is usually called a "CRC Error" (Cyclic Redundancy Checksum Error).

All sorts of things can cause this. A telephone ringing near a floppy is near certain doom for that floppy. Putting floppies near a monitor or power supply is as good as putting them in a microwave. It could also be a media fault, in which a small flake of the disk's surface comes off.

I don't want to make you paranoid, but the older ROM versions of the ST (the non-Mega ROMs) have a little bug: They don't always recognize a CRC error when they see it! That's right--this means you can have a bad diskette, and go merrily right on working with data that is almost certainly bad. Typically, one or two bytes per sector will be changed.

Since I do my taxes on a computer, this little detail gives me the cold sweats.

Using The Program

To use the Disk Certifier, boot in high or medium resolution. UN-ARC the file CERTIFY.ARC, following the Disk Instructions elsewhere in this issue. Double-click on CERTIFY.PRG; tell it which drive to check, and whether the disk is single or double sided.

The Certifier presents a display of 80 tracks in rows across the screen and 9 or 10 sectors per track down the screen. (If you select two sides, you'll get two displays.) The Certifier reads disks in a track at a time; this is to speed up the reading process. If it finds an error, it goes back and reads the track one sector at a time.

What should you do if you find a bad sector?

First, examine the disk. Open the little window and spin the disk around using the center spindle on the back of the disk. Look for flecks, scouring or mayonnaise (my daughter Jennifer pulled that particular one--I kid you not). If the disk seems physically okay, then go copy everything off it--one rule about disks that are going bad is that they seem to get worse (I don't know why this is, but I've seen it happen many a time. If it's marginal media to begin with, you've probably got other files gradually going bad. Scary, eh?)

However, if something is obviously wrong with the disk, don't put it back in your drive! The read/write heads in your drive are easily scratched, and if that happens, your drive is totalled, kaput, worthless. This means hundreds of dollars to replace the drive. Compare that with a $1.50 disk. . .

Even on pain of death, I won't tell the story of cleaning mayonnaise off the heads of my 1040's internal drive with rubbing alcohol and Q-Tips. Never. Okay, so you've copied the data off the disk. What now?

You can also team the Certifier with a sector editor. Since you'll see the track/sector that went bad, you can look over the sector, and perhaps fix whatever went wrong. Rewriting a disk sector that has a CRC error will fix the error, if it's fixable (a magnetic field going sour instead of a physical media problem). So if it's a word processor document, for example, and there's a typo where the sector failed, you can fix it. For instance, the desk accessory TinyTool, available on most online services and many ST BBSs, is able to edit raw sector data.

Finally, if you use the Disk Certifier with a file-oriented editor, such as the Byte Mechanic from Special Issue #4 of START, you can find out what file has been damaged, and go to a backup of it to get good data. This is especially helpful in the case of binary files or numeric data, where you can't tell what's gone bad.

Coming Attractions

Next issue's Small Tools will be dedicated to hard disks and the poor souls chained to them. Given the amount of trouble I've had with hard disks, expect a particularly full column!

Dave Small, formerly of Data Pacific, is the creator of the Magic Sac Macintosh emulator and the Translator One disk controller. Dan Moore is the author of PaperClip for the 8-bit Atari computers.