MS-DOS 6.22 UNFORMAT Command Explained
The UNFORMAT command in MS-DOS 6.22 is a built-in
recovery utility designed to restore disks that have been accidentally
erased using the FORMAT command. By attempting to rebuild
the disk's File Allocation Table (FAT) and root directory,
UNFORMAT enables users to recover lost partitions,
directories, and files on both floppy disks and hard drives.
Primary Function and How It Works
By default, the MS-DOS 6.22 FORMAT command performs a
"safe" format on floppy disks and hard drives. Instead of wiping the
entire surface of the disk, it clears the FAT and root directory to make
the space appear empty, while saving a copy of the original file table
in a hidden image file at the end of the disk.
The UNFORMAT command primarily functions by:
- Locating the Mirror File: It searches the disk for the backup image of the FAT and root directory generated during the last safe format.
- Restoring File Allocation: If this mirror file is
found,
UNFORMATuses it to restore the FAT and directory structures to their pre-formatted state with near-complete accuracy. - Sector-by-Sector Reconstruction: If no mirror file
is detected,
UNFORMATcan perform an ad-hoc scan of the disk, searching for subdirectories and allocating file chains manually. While less reliable for fragmented files, this method can often recover intact directory trees.
Common Syntax and Switches
The basic syntax for the command is:
UNFORMAT drive: [options]
Key switches supported in MS-DOS 6.22 include:
/J(Verify): Checks the target disk to verify the presence of mirror tracking files without actually restoring any data./TEST(Simulation): Simulates the recovery process and displays how the disk would be reconstructed, without writing any changes to the storage medium./L(List): When used without a mirror file, it lists every file and subdirectory found during the search process./P(Print): Sends the recovery status messages and file listings directly to the primary printer (LPT1).
Limitations
The UNFORMAT command cannot recover data under all
circumstances:
- Unconditional Formats: If a disk was formatted
using the
/Uswitch (FORMAT drive: /U), existing data sectors are physically overwritten with blank values, making recovery viaUNFORMATimpossible. - Overwritten Data: Any new files written to the drive after formatting will permanently destroy the sectors containing the original files and recovery tables.
- Network and Virtual Drives: The utility cannot be
run on network drives,
SUBST-mapped drives, or drives reassigned withASSIGN.