14

It is necessary, that the floppy drive, just like CD-ROM, attempts achieving 100% data integrity using the help of error correction. If a sector is not readable, it just does not get sent to the computer.

Software does require full data integrity of course.

However, optical drives have an SCSI command for disabling 100% of data integrity, which could be useful for pictures.

If the sector is not readable 100% with error correction, the drive does return partial data. This is also by default the case on CDDA, where error correction is weaker than on CD-ROM (C3 layer missing).

Is there a way to make the floppy drive return approximate data even from just partially readable sectors?

1
  • 2
    Ok has anyone ever heard of ST Recover for The Atari ST? It actually writes to an image file and repairs the sectors, this program could be implemented for other systems. To find out more information google ST Repair Atari ST. Commented Oct 28, 2018 at 5:17

9 Answers 9

20

(Answer based on WD1770, a prominent standard Floppy Disk controller from ~1980)

Standard Floppy controllers don't have any error correction at all. So there is nothing to switch off.

They support a simple CRC (error detection), both on the ID fields (the sector header identification) and the data sector itself, to be able to identify they have found the correct sector on the disk and the data sector is intact. In case the first CRC fails, the drive cannot be sure what and where on the disk it has actually read - It wouldn't make much sense to send the data to the computer in this case - The host computer simply gets a "Sector not found" message. In case the second CRC fails, the data is still sent to the computer, but marked as defect.

Within the sector's actual data field, there is neither any data correction nor error detection beyond this CRC performed by the drive controller. Any such process is done on the host computer (in fact, in most cases it isn't, for performance reasons, the checks are rather done on file system level), the contents read from the data bytes of a sector are simply forwarded in raw form to the host computer. What the host computer does with defective data, is up to the OS and application. Specific programs can try to rescue as much as possible.

So what you assume to be an optional rescue operation actually is standard behavior for a floppy.

As long as the controller can be sure it at least hit the proper sector (header CRC OK), it will send whatever it has read from that sector's data bytes to the host. In case the data integrity could not be verified (data CRC failed), this will be signaled to the host as well.

17
  • 3
    Its theoretically possible you could even recover data from a disk with damaged sector information if you used one of the modern USB-connected micro-controller based drives that doesn't rely on the traditional floppy interface standard internally, although that would require some custom firmware on the drive and probably a custom driver on the computer to allow you to read in an entire track at once. Commented Jan 16, 2018 at 8:12
  • 8
    This gets Off-Topic: Most contemporary floppy drives cannot be logically considered "floppy drives", but rather logical block devices ("USB-sticks") that just happen to store logical blocks on a floppy in the same physical format as the IBM PC. This physical format is built into a µC on the device and cannot be changed - That is why these drives can't normally use disks in, for example, Acorn RISC or Amiga formats. What the µC can do in case of errors is just stubbornly re-try until it eventually gets the sector with no error. But that has nothing to do with error correction. Commented Jan 16, 2018 at 9:14
  • 3
    @mnem You wouldn't need custom firmware on the drive - Standard drives already can do what needs to be done (stepping in-between sectors). Specific software not using a standard disk conmntroller can read the modulated data stream from a disk directly and record that. The host computer can then decode whatever it gets from there. That is what, for example, the KryoFlux device does. It is, however, impossible to detect any errors from the raw bits - Error detection then needs to be done by the host computer. Commented Jan 16, 2018 at 9:23
  • 2
    @mnem Devices like Kryoflux, however, will obviously still not be able to read anything from a disk that is no longer there - They are not intended as data rescue devices, but rather as a reader of formats that are not supported by standard floppy disk controllers. Commented Jan 16, 2018 at 9:33
  • 3
    @tofro I didn't intend to mean that you could recover corrupted data that way, just pull in the "raw stream", as you say, to get around corrupted sector markers and read the rest of the uncorrupted data. I meant that it should be theoretically possible to reprogram the µC on a modern USB floppy to make it function similar to the KyroFlux, etc. Commented Jan 16, 2018 at 9:42
12

At secondary school I was dealing with Agat computers at school computer class (exactly, this was Agat-7), approximate clones of Apple II series. Their 5″ diskette drives were also clone of 140kB drives designed by Steve Wozniak and Shugart for Apple II, with hardware adjusted to what could be produced in the socialism camp. One may find a deeply detailed description of the drive here. There were some weird design choices, as the absense of an zero track sensor. To seek to the zero track (after reset or I/O error), it unconditionally performed 160 steps of the head position stepper motor. This caused gradual disbalancing of the head positioner through regular impacts into seeking limiter (with a loud, machinegun-like burst sound). As result, at my final class at the school, the computer lab consisted of 3 groups of 3 computers each, where one computer can easily read diskettes written by another computer in the same group, but struggled with diskettes from other groups. And, this issue was known throughout the entire Agat park.

To solve the readability problem, a program called COPYTREK was developed (by a Moscow firm associated with the factory that produced these computers) to recover unreadable diskettes. It tried to read all sectors of a track in the following manner:

  1. It applied brief affections to the stepper motor to make it turn to an angle less than a single step, positioning the read-write magnetic head at offsets like "1/8 of the track interval", or kept two neighbor phases turned on to position the head just between them. A sector was being read multiple times with different head offsets, to find a best reading result.
  2. Besides (1), multiple readings were applied to find unstable bits and statistically determine a most probable variant.

There were no algorithmic recovering due to lack of redundant bytes (as most current drives utilize Reed-Solomon or similar methods), only a single XOR CRC byte, but this was enough in most cases. After reading, user could command the program to write a track back to diskette, according to the current drive "tuning". (It would ask if you wanted to replace the diskette with a target one, if you preferred to preserve the original.)

All this weird magic was specific to so-called 140kB Shugart drive (35 tracks of 16 sectors of 256 bytes). Just after my graduation from the school (1990), it had got a few computers of a new model, with 840kB drive that was saved of this issue due to adding of zero track sensor. (But this was time of a speedy decline of Agat usage due to import of MSX and IBM PC series.)

I hope this will answer your question, despite this was not PC specific.

4
  • 3
    The question wasn't PC-specific, so this answer is valid. It's also quite interesting. Thanks for sharing it! :-) Commented Mar 31, 2018 at 10:14
  • 1
    Relatively few inexpensive drives of that era had zero-track sensors. Commented Apr 1, 2018 at 14:46
  • Apple ][ disks don't have a zero track sensor and use the same "unconditional step down" when booting to access track 0, resulting in the distinctive loud clatter from the drive hitting the end stop when booting. I don't recall seeing problems with the head getting misaligned, however. Commented Sep 5, 2024 at 21:58
  • @ChrisDodd Thanks for the notice. So there was a principal difference in mechanical design of the drives that Agat versions (by "Izot" from Bulgaria) didn't tolerate this clatter. The drives utilized a flat plastic disk with a spiral furrow residing on a stepping motor shaft; R/W head was linearly moved by the groove "plough". (Sorry for terminology mismatch.) Maybe tuning would have been easy but at school we weren't having respective tools... Commented Sep 7, 2024 at 7:11
5

In most cases yes.

Utilities were available for most computer systems of the '80s and '90s that would read the disk at a low-level and attempt to deduce the track/sector information. These reads would bypass the filing system software - going directly to the controller.

For example, the Intel PC had Norton's Disk Doctor, amongst others. The BBC Micro had Computer Concept's Disc Doctor. Such utilities would have commands to read at low level as best they could. The recovered data could then be examined and edited reconstruct the valid information. This could then be saved.

The example Disc Doctor command to read was *RECOVER, an extract from the instruction manual is below.

Disc Doctor Manual for *RECOVER

Of course, if the disk were too badly corrupted, you couldn't recover anything.

1
  • 5
    While this is interesting, it doesn't really answer the question. The question is asking about reading damaged sectors and by-pass an assumed error correction on he disk, which isn't there - "Disk Doctor" and the likes were intended to by-pass and repair damaged file systems. That's one logical level above the question. Commented Jan 16, 2018 at 10:39
4

What you really want is SpinRite by Steve Gibson (Gibson Research Corporation), which reads the surface of the disk repeatedly, until it derives the data from a failing byte structure, giving a very high degree of data integrity.

Typical software for drive recovery only makes a single pass, but SpinRite is user-configurable to run a large number of repeated attempts on a single sector.

Quite often the magnetic properties of a single byte survive, but at too low a level for traditional software to reliably detect it with a single pass on the sector, but Spinrite uses a special algorithm which, in my experience, is particularly effective.

The first version was released in 1987. The final stable release for DOS/FAT filesystems was version 6.0, released June 7th 2004.

1
  • 2
    spinrite doesnt do floppies. Commented Sep 6, 2024 at 17:01
4

If the actual task at hand is recovering such data at any cost and effort, there is still the possibility of directly recording the read head signal on some recording and visualization device, eg a secondary PC with an analog data acquisition card, or a storage oscilloscope, then decoding it manually. Triggering the recording at the right moment could prove tricky, forcing the computer into a repeated read attempt for that sector could help. If the recording device can hold the analog data representing a whole track, using the signal from the index hole sensor as a trigger and making sure the track the damaged data is on is seeked to and not left could help.

3
  • 1
    I am not disagreeing or attempting to cast doubt. This is not my area of expertise and maybe I am wrong - but doesn't the head also read track alignment information? Meaning a composite mixed signal - not just data? Commented May 1, 2018 at 19:57
  • 1
    Are you referring to "embedded servo", as modern hard drives use? Commented May 1, 2018 at 22:28
  • 1
    Low level vs high level formatting... Commented May 1, 2018 at 23:26
3

Linux/Unix/Cygwin/winUnix utilities - has a command that will will read sector information regardless of it's integrity, security, purpose or format. If a storage device is physically capable of reading the data, the DD command will capture it. The DD command uses raw low level hardware requests directly to the storage devices hardware (when available) to get the information.

copy floppies

Linux dd cmd

dd disk cloning examples

1
  • 4
    For reading devices that contain damaged sectors, ddrescue would be a better bet - it is specifically designed for this, and uses a log file to keep track of which sectors it has and hasn't been able to recover. Commented Oct 28, 2018 at 22:09
2

Actually reading a disk is easy with ST Recover, it uses a special method of reading the disk that reads disks that are damages , ie unstable. it then trys to read bad secors and recover sufficient information from the damaged sector. The program ST Recover works on Atari ST disks and creats an image called a .ST file ,which then can be read on either Omniflop of FloImage (these two programs require an internal floppy drive in your PC), but ST recover can read normal 720 K disks whether they be Atari or PC. It will write a PC disk out as an Atari file but that is easy to write back out as A PC file. I will of course post the zip file for ST REcover here if allowed. Russ

1
  • 1
    Here's a link to ST Recover, and thank you for the answer! This is a much better answer than last time. I hope you continue contributing to the site. ☺ Commented Apr 7, 2019 at 16:49
1

Some floppy controllers only let you access the disk with sector/track level. So they succeed or fail at that level. You don't have any control at a lower level.

The Apple ][ and Macintosh floppy access was all done in software in the standard processor addressable memory like any other program. Additionally in the Apple ][ the code only knew where one nibble on the disk started and ended because the code was written taking the account of how every machine code instruction took. So, at that level, sectors didn't really exist and where only created by the patterns written to the disk. This meant you could read a whole track of data into memory no matter how corrupt. Whether it could be recovered would only depend on our skill and what remained.

1

Nowadays, the best hope for recovering data would be to use some kind of data acquisition subsystem to continuously sample the data output from the drive at a rate at least 4x the hardware's bit rate for a few seconds while the drive is spinning and the proper track and head have been selected. This will make it possible to observe some things about the nature of the corruption which would be invisible to an ordinary controller. Among other things, if one reads data for e.g. 3 seconds, then most sectors will appear about fifteen times. If one takes those traces and lines up the start of each sector, any data bits before the corruption will appear in almost precisely the same place on all fifteen times. Further, there may be some bits after the corruption which again show up identically on all fifteen reads.

If there's a glitch that clobbers a dozen bits, but the weaker domains cause the drive to produce signals that only look like it saw eleven bits, nothing past the glitch will be readable by a normal controller, but looking for parts of the data which have consistent repeatable timing will make it possible to identify exactly what parts are glitched, and how many bits would need to be in the glitched section to make everything else line up.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.