Windows 98 Scandisk After Improper Shutdown

In Microsoft Windows 98, an unexpected reboot or power interruption triggered the ScanDisk utility to run automatically before the operating system loaded the graphical desktop. The primary function of this automated scan was to verify the integrity of the File Allocation Table (FAT) file system, detect any data corruption caused by the sudden halt, and repair structural inconsistencies to prevent further data loss and system instability.

Why Improper Shutdowns Caused Issues

Windows 98 relied on the FAT16 and FAT32 file systems, which were non-journaling file systems. Unlike modern file systems, FAT did not maintain a log of pending changes. Additionally, Windows 98 used aggressive disk write caching to improve performance, holding file modifications temporarily in RAM before writing them to the physical hard drive.

When a computer was abruptly powered down, suffered a system crash, or was forcibly restarted via the reset button, several issues typically occurred:

  • Unsaved cache data was lost immediately.
  • Files that were actively being written to were left in a corrupted, incomplete state.
  • The disk's File Allocation Table failed to match the actual clusters stored on the disk.

The Trigger Mechanism

Windows 98 tracked the state of the drive using an internal flag, often referred to as a "dirty bit." During a normal shutdown sequence, the operating system flushed all memory caches to the disk, closed open file handles, and cleared this flag to mark the drive as cleanly unmounted. If the shutdown sequence was interrupted, the flag remained set. Upon the next startup, the boot loader read this flag and automatically executed the MS-DOS-based ScanDisk utility before loading the Windows GUI.

Key Functions of ScanDisk During the Boot Check

When invoked after a bad shutdown, ScanDisk performed several targeted verification and repair tasks:

  1. Fixing Lost Clusters: When an unexpected shutdown occurred during file allocation, sectors on the drive might be marked as "in use" in the FAT despite not belonging to any recognized file. ScanDisk identified these orphaned fragments and either freed the space or converted them into recovery files (with .CHK extensions).
  2. Resolving Cross-Linked Files: If an interruption caused two different files to point to the exact same cluster on the hard disk, ScanDisk corrected the pointers to eliminate conflicts and prevent applications from overwriting each other's data.
  3. Validating Directory Structures: The utility verified that folder structures, directory entries, and file sizes matched the actual cluster chains referenced in the File Allocation Table.
  4. Surface Analysis (Optional): While the default startup scan performed a standard file system check, users could allow ScanDisk to conduct a deeper surface scan to detect physical bad sectors on the disk platter.

Automation and Configuration

By default, the boot scan was controlled by the AutoScan setting located in the hidden MSDOS.SYS configuration file on the root of the boot drive. An AutoScan=1 value prompted ScanDisk to initiate automatically with a short countdown, allowing users to bypass the check by pressing a key, while AutoScan=2 ran the check automatically without waiting for user input.