Re: [Hampshire] Laptop Hardrive

Top Page

Reply to this message
Author: James Courtier-Dutton
Date:  
To: lug, Hampshire LUG Discussion List
Subject: Re: [Hampshire] Laptop Hardrive
On 19 May 2010 11:14, Vic <lug@???> wrote:
>
>> I would like it if Linux would at least tell me which files got hit by
>> the reallocation.
>
> It probably can't tell.
>
> Reallocation happens by way of the drive controller; the main OS is not
> involved, nor even informed unless it specifically asks. I'm not aware of
> any way to inquire about the reallocation map - if such a method exists,
> it's almost certainly manufacturer-specific and undocumented.


reallocations appear in the Linux syslog so one could match these up
with the filesystem and know which file was touched.

>
>> So, I lost 3 sectors, so which files have 512 bytes missing?
>
> None of them. That's the purpose of reallocating sectors, not just letting
> them fail.


That is false, a reallocation can happen if a sector fails to be
readable any more although it is true that the drive tries to spot
sectors that are about to turn bad, and reallocate them before they
fail.
A reallocation can also happen on write, where a read after write
check is done, and if it failed to write correctly, it instead
reallocates the sector and writes to the new location for that same
sector. In the "write" case, data is not lost.

>
>> I use sha256sum on all my picture files, so that I can detect which
>> one has gone bad, and then replace it from backup.
>
> That's nice for you, but has little to do with HDD sector reallocation.


On some consumer HDs, it can silently loose data for a sector without
warning. Reallocation is one way this happens, so sha256sum can help
with this.

I was talking to someone at a kernel summit and they were in charge of
a large array of test disks. They tried doing a sha256sum on data that
was unlikely to change and then went back 6 months later to compare
it. They were stunned at the amount of silent data corruptions that
had happened. Some were even single bit flips, which apparently disc
sector CRC checking is supposed to catch, but it did not.
I do not remember the person who stated it, but it was made by someone
who was trustworthy.

I do sha256sums on all my important files now, but fortunately I have
not observed a problem yet.

Kind Regards

James