Ubuntu – Difference between SMART reallocated sectors and bad sectors

hard drivesmartxbmc

After my 7-month old kicked my wife's laptop off the sofa, I've been in data recovery mode.
Data now recovered, laptop is old and is basically on the verge of being binned.

I decided to try and use the laptop for XBMCbuntu, and although the hard drive has issues – I'm hoping I can use it for saving xbmc settings and media – but no data I'd worry about if the hard drive truly fails.

My question is, what is the difference between reallocated sectors, and bad sectors?

My drive has a "Reallocated Sector Count" of 555, and I'm running the badsectors which is already up to 1083. I expected badsectors to check every sector, and I thought this would also increase the "Reallocated Sector Count" (as I assume this only increases as sectors are used).

From what I've read, it appears "Reallocated sectors" are unreadable/unwriteable sectors identified by the hard drive, which are remapped to another area of the drive – and this is transparent to the OS?

Bad sectors are sectors unreadable/unwriteable sectors identified by the OS, and are marked 'bad' to prevent their use by the OS.

I'm struggling to see
'a' how the OS can identify bad sectors, when the drive should be transparently remapping them?
'b' How my OS is finding more bad sectors than the drive has reallocated sectors? (are reallocations only triggered by 'write' actions?

A summary with a link to a detailed resource is fine – I don't mind the reading, but all the part-answers I've found so far say fun fsck, run badsectors or "replace the drive ASAP"

Best Answer

  • Your guess is right. The drive only reallocates a sector when a write operation fails. Check wikipedia. Also take a look at the Current Pending Sector Count S.M.A.R.T attribute. The pending sectors are those which had read failures but no write failures, upon writing to these sectors the sectors will be reallocated.

    The OS would know nothing about a remapped sector, because remapping is transparent, this means that is the OS try to write to a sector e.g 27643 and that write fails, then the drive will remap the sector internally to another physical area. Then when the OS tries again to write to sector 27643 it will succeed. The OS doesn't know that it is writing to a different physical area.

  • Related Question