Another interesting task that disk controllers perform is remapping of bad
sectors. If the controller detects that a sector is damaged when the disk is initially
formatted, or when an attempt is made towrite the sector, it can logically map the
sector to a different physical location (allocated from a pool of extra sectors set
aside for this purpose). The remapping is noted on disk or in nonvolatile memory,
and the write is carried out on the new location.