If you are seeing this then this page was served by a 40 year old PCjr running the mTCP HTTP server.
Visit brutmanlabs.org to see the machine config and a link to the server stats page.
Working with DisksAn intro to floppy disks and floppy drives
A few years ago I spent some time archiving my old floppy disks and I was reminded how much I hate them and how frustrating they can be. Cheap and large hard drives have really made computing so much more productive and enjoyable, and SSDs and thumbdrives have eliminated the fragile mechanical parts of data storage. However, older systems still use floppy drives and understanding how they work makes working with them much easier. Here is some background information on floppy drives and disks with some tricks for using them that you might find useful. While this page is geared to IBM PCs and compatibles, the basic concepts apply to other vintage computers.
8", 5.25", and 3.5" disks (Source: M. Brutman) BackgroundThe first floppy disks and drives were invented by Alan Shugart at IBM in 1971. Those original floppy disks were 8 inches in diameter and were designed to allow IBM to distribute microcode updates cheaply. The original versions stored 250KB which was a fairly large amount at the time.
Alan Shuggart went on to found Shugart Associates, which in 1976 introduced a smaller version of the floppy disk that was 5.25 inches in diameter. The new market for floppy drives led other companies to jump in, each with their own ideas on how they should work, leading to a wide variety of incompatible disks and drives. (The variations included things like how recording was done, how sectors were marked, rotational speed, track pitch, etc.)
When IBM created the IBM PC they chose to use a single sided, soft sectored, double density drive capable of storing 160KB on each side of a disk. Shortly after IBM started to ship double sided drives which combined with a software change allowed for 360KB of storage on a disk. The IBM PC, PC XT, and PCjr used that standard. Later machines introduced floppy drives with higher capacities or different sizes - the IBM PC AT used 1.2MB 5.25" drives while the IBM PC Convertible used 720KB 3.5" drives). The standard 1.44MB 3.5" that everybody recogizes as the "save" icon came later, and other variations such as the 2.88MB disk and various "super drives" were introduced but did not really catch-on.
Other personal computers such as the Apple ][, the Commodore 64, the Macintosh, etc. all of course did their own thing too. It was a mess, which is what makes it so interesting.
Anatomy of a Disk Source: IBM PCjr Guide to Operations Sectors and Tracks (Source: "Easily Into DOS")A floppy disk stores data on a flexible round sheet that has a surface coated with a compound that can store magnetic flux transitions. The media is supported and protected by an outer jacket. The recording technology is very similar to magnetic tape, except that the diskette is optimized for random access across the surface instead of streaming speed.
Disks are either single sided or double sided. Most disks are double sided, meaning that both surfaces are suitable for recording. Early disks may be single sided, meaning that only one surface was certified for data storage.
A floppy drive is a storage device that contains a spindle motor, read and write heads that move linearly on a track, a motor to move the heads, sensors, and support circuitry. When a floppy disk is inserted and mounted on the spindle the floppy drive can rotate the media in the protective jacket and the heads can access most parts of the media through an access slot in the jacket. Sensors are used to determine if the floppy disk is single or double sided, where track 0 is, is the floppy disk write protected, etc. The heads are in direct contact with the media, so eventually the media will wear out. This also makes the heads prone to picking up contaminants, like shedding oxide from the media.
Data is laid out on the surface of a disk in tracks and sectors. A track is a concentric ring at a fixed location from the center of the disk. A sector is a small area of a track. Unlike a vinyl record (which was current technology when disks were invented) or a CD-ROM, there are multiple tracks on a disk, not just one spiral. A stepper motor in the disk drive positions the drive heads to the desired track.
Data is written to the disk a sector at a time. There is no way to change just one byte of data - to change one byte, the sector containing the byte must be read, the new byte needs to be put in the buffer holding the sector, and the entire sector must be written out. Sector size is set by the drive and controller. IBM PC clones generally use a 512 byte sector.
A drive "formats" a disk before it stores data on it. The formatting process can be thought of as laying out "street signs" so that data stored on the disk can be found later. The "street signs" are numbers, identifying areas on the disk. Disks can be formatted in many different ways, but in general only a few well-known formats are used. The format used depends on the drive and the disk.
Double density 5.25 Inch drives and disksIBM introduced the PC with a single sided, double density 5.25" drive. This drive formatted disks to a 160KB capacity using just one side of the disk. If you wanted to use the other side of the disk you had to remove it and flip it over.
The original single sided drives were quickly replaced with double sided, double density drives capable of formatting a disk to 360KB in size. These drives also used 40 tracks per side, but the sectors per track increased to 9 and both sides of the disk could be used without flipping the disk over. By the time the IBM PC XT and PCjr were introduced double sided, double density drives were standard.
Below are the parameters for standard formats used by these drives:
Capacity Tracks/Sides/Sectors DOS Format command flag Comments 160 KB 40/1/8 /f160 Single sided; lowest common denominator for all IBM PC compatibles 180 KB 40/1/9 /f180 Single sided, but 9 sectors per track 320 KB 40/2/8 /f320 Oddball format - not used too often 360 KB 40/2/9 /f360 "Normal" format for 360KB driveThe sector size for IBM compatible computers is 512 bytes. Computing the capacity of a disk is just a matter of multiplication:
Sectors per track * Tracks * Sides * 512 = Total Bytes
For example, the 360 KB format shown above uses 9 sectors per track * 2 sides * 40 tracks* 512 byes per sector, for a total of 368640 bytes on a disk. (368640 = 360 KB)
A 5.25" disk is fragile compared to a newer 3.5" disk. The outer jacket is very flexible, and there is a large oval shaped hole where the media is completely exposed. The 5.25" disk is write protected by placing an opaque "tab" over the write enable notch on the side of the disk. (Scotch tape might not work because both optical and mechanical sensors were used on the write protect mechanism!).
Be careful when inserting a 5.25" disk! When you close the drive door or lever, the drive clamps onto the disk at the center. Close the door or lever slowly to allow the disk to center on the spindle; if you close it too fast you might not get the disk clamped on-center, which will make it impossible for the drive heads to follow the circular tracks!
The design flaws of the 5.25" disk were corrected on the 3.5" disk. The 3.5" disk has a harder casing, the media is protected by a shutter, and the hub ring was replaced by a much sturdier mechanism.
These disks generally spin at 300 RPM, or five times per second. The data rate from the controller is 250kHz, which means each bit takes 4 microsends to read or write. You only have 0.2 seconds to read or write a track, so at this data rate you can only store 50,000 bits per track. At 40 tracks per side that works out to 2,000,000 bits per side, or 250KB per side/500KB per disk. There is some overhead for marking the sectors on the disk and leaving a gap between sectors, so the effective capacity is reduced to 360KB per disk.
An improvement: The high density 5.25" driveIn 1984 IBM introduced its first high density drive. This drive was designed to use "high density" media, which allowed for data to be packed more tightly on the disk. This in turn increased storage capacity. Below are the parameters for the new format that this drive used for high density media:
Capacity Tracks/Sides/Sectors DOS Format command flag Comments 1200 KB 80/2/15 /f1200 Normal format for high density mediaHigh density media requires a different amount of magnetic force to write than double density media requires. Although all disk media looks alike, the media is different. High density drives can use double density media because they detect the media and change how they write to it, preserving backwards compatibility.
To support the additional data density the drive controller has to send data at a faster rate. High density drive controllers send data at 500kHz, which is twice the speed of double density drive controllers. With the faster data rate there is just 2 microseconds to read or write a bit of data.
These drives spin high density media at 360 RPM, which gives you a full track access time of 0.1666 seconds. That works out to 83,333 bits per track. These drives have 80 tracks so the unformatted capacity is 1.666MB, but just 1.2MB after overhead.
You may have noticed that the number of tracks doubled but the density of each track did not. That is due to the faster spin rate that is used for high density media. Spinning the media faster reduces the average wait time when trying to read data, at the expense of data density. If these drives had doubled the data rate and kept the same speed they would have held 4x as much as a double density 5.25" drive. (To be fair, the faster spin rate might have been chosen to match the capabilities of the media. Spining at 300 RPM might have exceeded the ability of the media to store the magnetic flux transitions.)
To double the number of tracks the heads have to be at least half the width as the heads of a 40 track drive. Instead of packing 48 tracks per inch, these drives have to fit 96 tracks per inch. This can lead to compatibility problems when writing double density disks that use the older, wider heads. (More on that problem later.)
A different improvement: The double density 3.5" drive 3.5" double density disk (Source: IBM, Options and Adapters, Vol 1)The standard 5.25" disk was fragile and inconvenient to work with. The 3.5" drive was introduced as an alternative to the 5.25" drive. It was especially popular for portable systems, where space was at a premium. Below are the parameters for the double density 3.5" drive:
Capacity Tracks/Sides/Sectors DOS Format command flag Comments 720 KB 80/2/9 /f720 Normal format for double density 3.5" driveThis format looks amazingly similar to the format used by the double density 5.25" drive, except that it has twice the number of tracks. This made it easy for computer manufacturers to transition to this format - it was a very minor change. They spin at the same speed and use the same data rate from the controller. Electrically the new drives looked like standard 5.25" double density drives.
Both Improvements Together: The High Density 3.5 Inch Disk DriveThe double density 3.5" disk was successful; the disks held more than the original double density 5.25" disks, the media was better protected, and they were convenient to use. Moving to high density media made for the most successful type of disk in personal computer history - the ubiquitous 1.44 MB disk. Below are the parameters for the high density 3.5" drive:
Capacity Tracks/Sides/Sectors DOS Format command flag Comments 1440 KB 80/2/18 /f1440 Normal format for high density 3.5" drivesLike the high density 5.25" drive, these drives need high density media to write the higher capacity format. Unlike the high density 5.25" drives, these drives only spin at a single speed (300 RPM). Using the faster data rate the drives take 2 microseconds per bit, laying down 100,000 bits per track. That gives them an unformatted capacity of 2MB, or a formatted capacity of 1.44MB. With double the data rate and the same rotational speed they hold twice as much as their predecessor 3.5" double density drives, and four times as much as the 5.25" double density drives.
A few words on density and format Before going further, I want to more precisely define density and format:Density is a description of the physical media and how much magnetic force is required to write data to the media. A double density disk has a different coating and has a lower maximum storage capacity than a high density disk. A quad density disk has yet a different coating that enables even more data to be stored on the media.
When speaking about drives, density refers to the types of media a drive can write to. A double density drive can only be used with double density media, while a high density drive can be used with both high density and double density media. To take advantage of the media, the drive has to be able to accept data from the controller at a faster rate. Double density drives generally use a data rate of 250kHz while high density drives use a data rate of 500kHz. The higher density drives maintain backwards compatible with the lower density media by varying the data rate, magnetic force used to write, and possibly the rotation speed.
Format describes how data is logically written onto the media. Formatting a disk marks where sectors are going to be on the disk. A high density disk is capable of storing more data in the same physical space, so it can have more sectors per track than a double density disk. While most people will choose a format that maximizes the capacity of the disk, that is not a requirement - you can choose to format a diskette with a "relaxed" format that does not push the limits of the media. Here are some concrete examples:
Note: I pretty much ignore "quad density" or "extended density" media in this discussion because they are unusual to find. There were some 2.88MB floppy drives out there, but CD-ROMs basically killed those off. The general rules are the same though; it's a different media type from the others.
Rules of thumb for data interchangeMost people with a 3.5" floppy drive are used to having that floppy drive work in any other floppy drive. While that is true for most PCs built in the 1990s and 2000s, it was not true for older computers. Some care must be taken when working with older systems or you can corrupt your data.
Here are the factors to consider:
Let's start with the easy case first: density differences.
Density differencesThe recording surface of a double density disk is different than the recording surface of a high density disk, and they are not directly interchangable. Floppy drives mask over this difference by detecting and adjusting their write current depending on the media that is being used.
Use a double density disk in a double density drive No problem: it is doing what it was designed to do Use a double density disk in a high density drive No problem: it is doing what it was designed to do. The high density drive will adjust to the media being used. Use a high density disk in a high density drive No problem: it is doing what it was designed to do Use a high density disk in a double density drive Problem: This is the wrong media for the drive and the drive will use the wrong amount of write current to write to it. If it works it will be temporary and you will expose yourself to data loss. Modify a double density disk or defeat the sensor in a high density drive to make the double density disk look like a high density disk. Problem: Double density media isn't formulated the same way as high density media. Trying to fool the drive will result in it using a high write current that can oversaturate the media. The data probably won't be readable and a double density drive will not be able to reformat the disk. You will need a magnetic bulk eraser to make the disk usable again.In short, don't try to use a high density disk in a double density drive or try to force a double density disk to act as a high density disk.
How can you tell double density media from high density media? The disk should be labeled with either a "DD" or an "HD". Sometimes the words "Double Density" or "High Density" are used. The formatted capacity may also be specified. In the absense of any markings, a double density 5.25" disk usually has a hub ring which reinforces the disk where the disk drive clamps the media while a high density disk does not usually have a hub ring. You can't see a hub ring on a 3.5" disk because the mechanism is different, so you just have to hope the disk is labelled correctly. On a 3.5" disk you can also tell a double density disk by the lack of a square hole on the opposite side of the write-protect mechanism. (High density disks have another hole, where double density disks do not.) (Thanks to Octavio Alvarez for the tip.)
Old double density drives always assume that they have double density media. They will try to write to a high density disk, but it will either fail or not work reliably. High density drives usually have a "media sensor" that will tell it what type of disk is inserted. This allows the drive to fail if it is told to format a low density disk with a high density format. Some disk drives and controller combinations did not implement this correctly so do not rely on the hardware to prevent you from making a mistake.
The important thing to remember is that density refers to the storage capacity of the media or the capability of the drive to use different media, while format is a logical construct that can vary widely. No matter what media is used, the drive still has to support it and use the correct levels of magnetic force to write data to the media.
Now for track width ...
Track width considerationsTrack width differences only apply to 5.25" drives. Remember, the first 5.25" drives started at 40 tracks and then high density drives used 80 tracks. To make that happen the track width had to be halved. 3.5" drives are always 80 track drives so their track width never changed.
Track width is a problem when writing a diskettes and moving them between double density and high density drives. Assume you are starting with a factor fresh, unformatted diskette with absolutely no data on it:
Format and write a double density disk in a double density drive Read the disk a high density drive No problem: the narrower head in the high density drive can read the wide track Format and write a double density disk in a high density drive Read the disk in a double density drive No problem: the wider head of the double density drive should be able to read the narrow track Format and write a double density in a double density drive. Write to the same disk a high density drive. Problem: The narrow head of the high density drive can't completely cover the previously written track. The data might be readable in a high density drive but it might confuse a double density drive, which now sees part of a wider track overlaid with a new narrower track.So the short story is don't write a double density diskette in a high density drive and then expect a double density drive to be able to read it. The narrower write head overwriting the wider preexisting data can confuse the wider drive head in the double density drive. You can reformat the disk in a double density drive and use it again, but you won't be able to write to it reliably from a high density drive because the tracks were written in a drive that has wider heads than the high density drive.
If you make this mistake it is not the end of the world.
If you must write double density media in a high density drive and read it in a double density drive you have to start with a factory fresh diskette that has never been formatted or used before. (Or buld erase it before formatting it in the high density drive.)
Archiving disksEvery person who relied on floppy disks knows the value of a good backup. Floppies are very unreliable compared to hard disk technology or tape; they were designed for moving data between systems easily and cheaply, not for long-term archival storage.
There are many ways to make backup copies of your floppy disks. Here are the methods I use:
File copyingThis is the most simple way to preserve data. Copying the files to a different device or media type is easy to do but it does have some potential pitfalls:
Archivers are like file copying except that you can copy groups of files and the group is compressed to save space. The utility that archives the files also has a way to extract files from the archive. The archive file takes up less storage, is easier to manage than multiple files, and takes less time to transmit.
PkZip is the most common file archiver for old DOS systems. Other older file archivers include InfoZip, Tar, LhArc, Arc, Zoo, etc. Most of these formats are still supported by modern archivers today.
File archiving has most of the same problems as file copying. One key difference is that file archivers can detect corruption in the archive, so that you will at least know if the data has been corrupted since it was archived. Knowing the data was corrupted won't help you recover it, but if you have two copies of the archive then the other one is hopefully readable.
DOS DiskcopyDiskcopy is a DOS command that makes an exact copy of your entire disk on another disk. All parts of the disk including hidden files, system files, and previously deleted files and slack areas are copied, making it suitable for analysis or forensics later on. And of course a bootable disk copied with Diskcopy will also be bootable, making it suitable for cloning your boot disks.
Diskcopy does not work with copy protected disks. Diskcopy also requires that the target and source disks are the same type and capacity. Diskcopy can not handle errors on the disks.
Disk imagersDOS Diskcopy is limited to reading and writing physical disks. A disk imager adds the ability to create a file that represents an image of a full disk, or allows you to recreate a disk from an image. Think of it like DOS Diskcopy, but now you can choose a file as either the source or the target of the operation.
Disk imagers are great for archiving diskettes because like DOS Diskcopy, they capture the entire disk including the boot sector, hidden files, and slack areas. But the image is a file that you can move around and copy as needed. Virtual machines, Linux and DOS emulators also can work directly with disk images, allowing you to minimize the use of physical disks.
CopyIIPC/CopyWrite/TeleDisk/Etc.These programs are like diskcopy, except that they can reproduce copy-protected disks. These programs were usually purchased to make backups of copy protected games. They can be used on non-copy protected disks that have read errors. (DOS Diskcopy can not handle this case.) Some of these programs only copy a disk onto another disk, while others can create disk image files that can be copied and moved around like large files.
While these were a good solution for handling copy-protected disks many years ago, most of them do not work on modern hardware. Modern hardware generally does not have a floppy drive controller in the chipset, and USB floppy devices are just generic storage devices to modern machines. Even older hardware that has a floppy controller in the chipset often does not work because of speed and timing differences between them and the original machines these programs were designed for.
Back when I was using a PCjr I used all of these methods except for disk images. (The PCjr only supports double density 5.25" drives and there was no other storage, so an image file could not be handled.) When it came time to preserve my disk collection I decided to use both Zip files and disk images. For each disk I create a disk image and a Zip file. The disk image is good for archival purposes, and the Zip file lets me retreive individual files quickly. Zip files are compressed as part of the archiving process, while disk images can be compressed separately to save space. (The easy thing to do is to make a Zip file of the disk image, which also adds the ability to detect data corruption in the disk image file.)
For non-copy protected disks I create a disk image that is just a dump of all of the sectors on the disk without any metadata or compression. Most disk imaging programs and virtual machines can use this type of image. Here are some programs you can use:For copy protected disks you originally had very few options:
Things have improved a lot in the past few years, and now there are modern projects that are capable of imaging floppy disks for archival purposes:
Whatever method you choose, remember to test it thoroughly! As with any backup, it is not good unless you have tested it.
Handling Disk ErrorsDisks can (and will) go bad. Usually they start by developing "soft" errors, which are recoverable by retrying the operation several times. Eventually the soft errors turn to "hard" errors that can not be recovered.
How do you know when a disk is starting to go bad? Your first clue will be an error message like "Disk error reading Drive x, Abort, Retry, or Ignore?" When you start to see that happen to a disk, it is time to do something.
If you get your files off the disk safely, there are some steps you can take with the disk. It is not necessarily bad, it just may need some help:
It does not pay to try to reuse a floppy that format reports has bad sectors. If format can't handle the disk it has reached its end of life. The disk may be physically damaged, and you may lose more data in the near future.
Disk drive malfunctions QumeTrack 142 (Source: M. Brutman)Not every floppy disk error is caused by the floppy disk. The drives are all old now and they wear out too. Here some of the problems I have run into:
Be careful when attempting to clean or adjust a floppy drive. When in doubt, seek help from somebody who has more experience.
Created in July 8th 2001, Last updated January 17th, 2022
(C)opyright Michael B. Brutman, mbbrutman at gmail.com
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3