This section discusses how Windows NT automatically recovers from some kinds of disk errors. You do not even know that an error occurred.
Windows NT provides two kinds of disk error recovery:
Windows NT Server provides additional recovery mechanisms for fault-tolerant volumes (mirror sets and stripe sets with parity). For more information about fault-tolerant volumes, see Chapter 5, "Preparing for and Performing Recovery."
The following table summarizes what happens if a sector goes bad on a computer running Windows NT Server. There is more information about sector sparing and cluster remapping following the table. For more details, see Chapter 5, "Volume Management and Fault Tolerance" in the book Inside the Windows NT File System.
| FtDisk installed with a SCSI disk that has spare sectors | FtDisk installed with a non-SCSI disk or disk with no spare sectors |
|
Fault-tolerant volume (Windows NT Server only) | 1. FtDisk recovers the data. | 1. FtDisk recovers the data. | N/A |
Non-fault-tolerant volume | 1. FtDisk can't recover the data. | 1. FtDisk can't recover the data. | 1. Disk driver returns a bad-sector error to the file system. |
Note
FtDisk is the device driver that handles I/O to volume sets, stripe sets, mirror sets, and stripe sets with parity. However, volume sets and stripe sets are not fault tolerant, so processing of an error on one of these volumes falls into the non-fault-tolerant volume category.
If a disk read error occurs on a file on a fault-tolerant volume on a hard disk connected to a SCSI controller, Windows NT Server uses a technique called sector sparing to recover the data. Windows NT Server obtains a spare sector from the disk device driver to replace the bad sector. It then recovers the data by reading the sector from the mirror disk or recalculating the data from a stripe set with parity, and writes the data to the new sector.
This processing is transparent to any applications performing disk I/O. Sector sparing eliminates error messages such as the "Abort, Retry, or Fail?" that occur when a file system encounters a bad sector.
With transaction logging and recovery, NTFS guarantees that the volume structure will not be corrupted, so all files remain accessible after a system crash. However, user data can be lost because of a system crash or a bad sector.
The NTFS file system implements a recovery technique called cluster remapping. When Windows NT returns a bad sector error to the NTFS file system, NTFS dynamically replaces the cluster containing the bad sector and allocates a new cluster for the data. If the error occurred during a read on a non-fault-tolerant volume, NTFS returns a read error to the calling program, and the data are lost. When the error occurs during a write, NTFS writes the data to the new cluster, and no data are lost.
NTFS puts the address of the cluster containing the bad sector in its Bad Cluster File so the bad sector will not be reused.