FreeDOS DISKCOMP: Track Comparison, Drive Swaps, and Verification Limits
Use FreeDOS DISKCOMP to compare floppy media deliberately, interpret track-limited options, and avoid confusing a successful comparison with repair or preservation.
FreeDOS DISKCOMP compares the contents of two floppy disks track by track and reports whether they differ. It is a comparison utility, not a repair tool, and its abbreviated modes can intentionally compare less than the full medium. Before relying on a “same” result, establish which disks were read, whether all expected tracks and sides were included, and whether the comparison completed without device errors.
DISKCOMP is most useful after copying a disk or when checking two expendable media copies. It is not a substitute for a preservation image, a checksum manifest, or filesystem validation. Its output describes a comparison under the selected access path and options; it does not establish that either disk is correct, bootable, malware-free, or readable by a particular application.
Decide what “equal” must mean
For routine duplication, an operator may want to know whether two floppy disks contain matching sectors in the ranges the utility examines. For data recovery or archival work, the requirement is stronger: preserve the complete source, record unreadable sectors, retain acquisition metadata, and verify the stored image independently. DISKCOMP does not create an image or provide a recovery map, so keep that distinction clear in a runbook.
The FreeDOS help says comparison is performed track by track and documents options that restrict the comparison to one side, the first eight sectors per track, or the first forty tracks. Any such restriction changes the coverage. A successful result with /1, /8, or /4 does not imply that every side, sector, or track on a disk was compared. Use the unrestricted mode unless a specific diagnostic question justifies a narrower range, and label the result accordingly.
Floppy drives and media can have mismatched capacities, density, controller timing, or physical condition. A read error is not evidence that two sectors differ in content; it is a failure to obtain a trustworthy comparison. Record the exact drive, media label, drive type, and error output. If the source is deteriorating, minimize repeated reads and create a recovery image with a specialized tool before routine comparison.
Command syntax and drive handling
The documented syntax is:
diskcomp [drive: [drive:]] [/1] [/8] [/4[0]] [/b]
With two distinct drives, specify both letters only after confirming the physical media in each drive. With one drive, DISKCOMP reads the first floppy and then prompts for the second; the operator must exchange the disk at the prompt. Read the displayed instructions and check the handwritten identifiers rather than relying on memory. Swapping in the wrong order can invalidate the comparison even if the program runs to completion.
If no drive letters are supplied, the FreeDOS help says the current drive is assumed when it is a floppy. Avoid that implicit behavior in a maintenance script. An explicit pair communicates intent to a reviewer and makes an accidental change in the current drive less likely to redirect the operation.
The /B option forces access through the BIOS. The FreeDOS documentation describes that path as slower but potentially necessary for compatibility on some machines. Treat it as an access-path fallback, not as a mode that proves greater accuracy. It may behave differently from direct controller access and can be useful to isolate a compatibility issue. Record which path was used so later comparisons are reproducible.
Interpret scope-reduction switches carefully
/1 compares only the first side even when the disks are double-sided. It can help isolate a side-specific issue, but it is not a whole-disk check. /8 compares only the first eight sectors of each track. /4 is a shortcut for /40, comparing only the first forty tracks. A disk formatted with a different geometry can contain relevant data outside those ranges.
Do not choose these switches simply to make an error disappear. If a full comparison fails and a restricted comparison succeeds, the result narrows the location or scope of the difference; it does not show that the ignored portion is safe. Re-run the full comparison on healthy working copies when the goal is whole-media equality.
The utility documentation states that DISKCOMP can display an MD5 digest of disk contents and set an ERRORLEVEL / EXITCODE. A digest is a compact identifier for the bytes actually included in that operation, but do not assume the displayed digest captures un-read sectors or expands the scope of a restricted mode. Preserve the command line, drive selection, options, output, and program version together. If the result is used as an archival integrity record, hash a full-sector image with a separate tool and store the digest independently.
Safe comparison sequence
Start by making the roles explicit. Ensure both disks are expendable copies or that the source is protected from writes. DISKCOMP is intended to read and compare; still, use write-protected source media where practical and never combine the test with a formatting or restore command in one unattended sequence.
For two drives, a simple full comparison is:
diskcomp a: b:
For a single drive, the documented workflow can be invoked with the same drive named twice:
diskcomp a: a:
The second form requires the operator to exchange disks after the first disk is read. Label the first and second media before starting and note which was inserted at each prompt. If a command is run through a shell with ASSIGN drive remapping enabled, the letters may not identify the physical device expected; FreeDOS documentation specifically warns against using ASSIGN with DISKCOMP. Check and clear assignments before the comparison.
If the comparison reports a mismatch, do not immediately format or copy over either disk. Preserve both sources, make independent images if feasible, and compare directory listings and critical files on copies. A mismatch may be an expected difference in unused sectors, boot sectors, timestamps, or other media structure. Establish whether the task expects logical file equivalence or full sector identity before classifying it as corruption.
Exit status, logs, and troubleshooting
The FreeDOS help says DISKCOMP sets ERRORLEVEL / EXITCODE appropriately, but it does not provide a complete numeric map in the command page. Do not invent a numeric success code in scripts based on a different DOS utility. Check the installed version’s built-in help or source, capture the actual return code, and test the exact build with known-equal and known-different disposable images before automating it.
When a disk cannot be read, verify the media type, drive density, head/track range, and controller path. Try /B only when there is a compatibility reason and record that choice. Do not use /8 or /1 as a generic recovery technique; those options omit content. Persistent read errors call for controlled imaging and recovery, not an increasing sequence of unrecorded retries.
DISKCOMP’s digest should also be interpreted within its documented scope. A digest that matches can help summarize the bytes observed, but it does not identify the physical source, prove that each medium was read independently twice, or establish provenance. A digest that differs shows that the compared inputs differ; it does not locate the cause or identify which copy is authoritative. Preserve the full console output and compare it with the acquisition record rather than treating one hexadecimal string as the whole audit trail.
If the only available drive is marginal, another full read can add wear without creating a trustworthy reference. Decide whether the goal is routine copy verification or preservation before starting. For preservation, take an image with a tool that records sector errors and uses a controlled retry policy; use DISKCOMP only on expendable copies or on a test question whose read cost is acceptable. Record skipped ranges if restricted switches are used.
For acceptance, confirm the two intended disks, full-range settings, selected access method, completion status, and output. If the task was file-level distribution, separately inspect representative files or compare a file manifest. If the task was media preservation, use a full image workflow and verify its digest. DISKCOMP can answer a bounded comparison question, but it cannot establish the history or correctness of either source.
Related:
- FreeDOS DISKCOPY: Floppy Media, Images, Verification, and Destructive Edges
- Diagnosing FAT Corruption on FreeDOS Without Making Recovery Worse
Sources: