Jump to content

Bad sector

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 203.206.137.129 (talk) at 12:59, 11 April 2009 (removed discussion points from article, mentioned non-disk devices, and specified *where* the sectors get marked (within file system)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A bad sector is a sector on a computer's disk drive or memory-stick that cannot be used due to permanent damage, such as physical damage to the disk surface or failed memory-stick transistors. It is usually detected by a disk utility software such as CHKDSK or SCANDISK on Microsoft systems, or badblocks on Unix-like systems. When found, these programs mark the sectors unusable (all file systems contain provision for bad-sector marks) and the operating system skips them in the future.

A modern hard drive comes with many spare sectors. When a sector is found to be bad by the firmware of a disk controller, the disk controller remaps the logical sector to a different physical sector. In the normal operation of a hard drive, the detection and remapping of bad sectors should take place in a manner transparent to the rest of the system. When the operating system begins to detect bad sectors, in most cases, it means that the surface of the hard disk is failing and the drive has run out of spare sectors with which to remap the failed sector.[citation needed] There are a variety of utilities that can read the SMART information to tell how many sectors have been reallocated, and how many spare sectors the drive may still have.[1]

A commonly held idea for operation with regard to bad sectors is that automatic remapping of sectors only happens when a sector is re-written to or re-written with zero-filled data. The logic behind this is presumably that even if a sector is having trouble reading it may still be readable with data recovery methods. However, if a drive knows that a sector is bad and the drive's controller receives a command to write over it will not reuse that sector and instead remap it to one of its spare-sector regions. This may be the reason why hard disks continue to have sector errors (mostly disk controller timeouts) until all the bad sectors are remapped: typically with an entire-drive zeroing of sectors. See the SMART attribute number 197 ("Current Pending Sector Count") for more information.[2]

Programs like HDD Regenerator can repair bad sectors in most cases. It is recommended to do a full harddisk scan using it.

References

  1. ^ Monitoring Hard Disks with SMART. Linux Journal, 2004.
  2. ^ Stephens, Curtis E, ed. (December 11, 2006), Information technology - AT Attachment 8 - ATA/ATAPI Command Set (ATA8-ACS), working draft revision 3f (PDF), ANSI INCITS, pp. 198–213, 327–344