[Tfug] Hard Drive Question
Adrian
choprboy at dakotacom.net
Fri May 26 21:46:31 MST 2006
On Friday 26 May 2006 18:19, Earl J Violet wrote:
> I have a hard drive with FAT32. Later I install Linux. Are the bad
> sectors found in the previous format procedure stored in the hard drive
> controller so Linux does not to write to them? I am assuming this but
> don't have any real information other than piecing together things from
> here and there.
>
Depends what you mean by bad sectors... Hard bad sectors should be
automatically remapped by the physical hard drive firmware. The OS is unaware
of any such occurrence unless directly queried or the remapping is failing.
If you are getting hard bad sectors, it means the hard drive has run out of
remappable spare sectors and it would be best to jump ship now, try to rescue
data, and buy a new drive.
Soft bad sectors, on the other hand, are what badblocks command (in conjuction
with mkfs) tries to detect and format around. If you reformated the FAT32
partion, and didn;t select the "check drive" option, then the previous soft
bad sectors were not included in the new format. If you didn;t do a disk
check previously and have reason to believe there might be bad sectors, then
you should probably move your data off and reformat it again.
*Hard bad sectors are those which the drive has determined to be
unreadable/unwritable after multiple attempts. *Soft bad sectors are those
which the drive had problems reading, but was able to recover after several
passes and/or CRC correction.
Using smartctl, you can investigate general disk error rates and get an idea
of the health of the drive. Hard bad sectors will show as something like
"Reallocated_Sector_Count" (depends on what tag the manufacturer has decided
to use), being the actual number of physically remapped sectors. Attempts to
read from soft bad sectors will show as something like "CRC_Read_Error" or
"Hardware_ECC_Recovered" (since power on). It is normal to have a few soft
errors from time to time... but if you are getting lots of "read on /dev/...
failed, sector xxx" errors in your kernel logs, it may be time to move on (or
atleast designate a large surrounding section of sectors as bad with
badblocks.
There is a tool you can use to investigate hard bad sectors, querying the
firmware for its map... if you were so inclined. It is called SCU, but it is
hard to find these days. (It can also do fun things like low-level format
disks, change block sizes to make standard disks into "special" 510-byte
block disks for your Netapp, etc.).
Adrian
More information about the tfug
mailing list