Re: new harddrive with media error

From: Tejun Heo
Date: Mon Jan 01 2007 - 05:28:01 EST


Al Viro wrote:
From the look of it, I'd say that it's size reported by disk being
more than what's accessible. Take a look at the block numbers...

How so?

ata1.00: ATA-7, max UDMA/133, 976773168 sectors: LBA48 NCQ (depth 0/32)

sda: Current: sense key: Medium Error
Additional sense: Unrecovered read error - auto reallocate failed
end_request: I/O error, dev sda, sector 976751999
Buffer I/O error on device sda1, logical block 976751936

It seems like a genuine media error to me. Many drives suffer a number of media errors in its lifetime. Read errors happen regularly and most such errors are corrected by ECC, but sometimes you're just not lucky enough. Some of them are real bad sectors while others might be due to degraded record quality even when the sector itself isn't necessary bad. In most cases, the drive will reallocate the area including the sector when you write to it.

Simply rewriting the affected file should solve the problem. Examine the result of 'smartctl -d ata -a' just in case. For data of any importance, it's always wise to use raid 1 or 5 and backup regularly. Both help keeping your data safe in more than one way. Raid re-sync is an easy way out of partial media failures and backing up not only gives you another copy of the data but gives the drives chance to detect degrading area quickly and reallocate before actual read failures begin to occur.

--
tejun

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/