NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NetBSD disk got bad sectors. What is the best course of action?



On Wed, 3 Jul 2013, Christos Zoulas wrote:
In article <20130703131324.GA12493%SDF.ORG@localhost>,
Mayuresh  <mayuresh%acm.org@localhost> wrote:
Seems there is physical damage to the disk.

Did fsck -f using another NetBSD system.

It shows presence of bad sectors.

Backed up the disk.

Now shall I try a reinstall or format and reinstall? Are there any other
diagnostic tools?

A *long* time ago, when disk got back sectors you could revive them
for a while by doing a low level format, or by marking specific
blocks as bad (badsect)... These days disk controllers handle bad
sectors automatically by reallocating the sectors that got bad from
a set of reserved sectors. When the disk starts reporting bad
sectors, this means that the reserved sector list has been exhausted
and there is no more spares. I would not risk putting more data or
trying to repair that disk. Unless you are of course either
emotionally or financially attached to the drive. Depending on if
it is scsi you can try format and defect management (scsictl), if
it is ata it probably has SMART and you can check the status (atactl).

I may be wrong, but I think the swap to a reserved sector only happens on a write operation. So reads will fail until you attempt to write back at which point future reads will succeed. With RAIDframe, the initial read failure fails the whole component and no writeback is automatically attempted (too bad as it could just copy from the rest of the array).

So if you know failed sector numbers, you could reallocate them by using dd if=/dev/zero seek=N count=1 (where N is the sector number) and then re-fsck.

If using RAIDframe, usually just the rebuild of the RAID array with -R is sufficient.

--
Stephen



Home | Main Index | Thread Index | Old Index