smartmontools-support

Dear David,
thanks for your help. I tried to do as described, but it didnt help.
> -----Ursprüngliche Nachricht-----
> Von: "David Greaves" <david@...>
> Gesendet: 27.06.09 23:14:08
> An: Juergen Bausa <Juergen.Bausa@...>
> CC: smartmontools-support@...
> Betreff: Re: [smartmontools-support] pending sector: bad blocks howto doesnt work
> Juergen Bausa wrote:
> > I use debian lenny on my system and have enabled smartmon testing. For some days now
> > I receive emails telling me that there are pending sectors:
> >
>
> > But debugfs does not find a corresponding Inode for this block. What does this mean?
> You're lucky.
>
> > It seems that the buggy sector isnt used at all. But why does smart report an error then?
> The disk self tests scan the disk, not the fs.
>
> > Could it be, that the block was used before for, but the file was erased in the meantime?
> Not relevant
>
> > What shoul I do? just overwriting the block with dd (dd if=/dev/zero of=/dev/hda3 bs=4096 count=1 seek=114681246)?
>
> The safest thing to do is to take the fs offline, calculate a start position a
> few blocks (100) before then copy off the faulty blocks for, say 200b:
> ddrescue -r5 -i <start>b -s <200>b /dev/$DEVICE /tmp/$DEVICE
I think I understand, what you mean. What I did, is the following:
- installed ddrescue. However, the executable is called dd_rescue. But I think its the
same program we're talking about
- syntax of dd_rescue is somehow different:
Options: -s ipos start position in input file (default=0),
-S opos start position in output file (def=ipos),
-b softbs block size for copy operation (def=65536),
-B hardbs fallback block size in case of errs (def=512),
-e maxerr exit after maxerr errors (def=0=infinite),
-m maxxfer maximum amount of data to be transfered (def=0=inf),
...
Note: Sizes may be given in units b(=512), k(=1024), M(=1024^2) or G(1024^3) bytes
This program is useful to rescue data in case of I/O errors, because
it does not necessarily abort or truncate the output.
So I used -s for starting position of input, -S for starting position of output (set to 0 in
order to copy only the interestiung part), -m is size to be copied. In addition, 'b' at the end
of a number means 512 Byte blocks, not 4096. So starting position is:
114681246 / 4096 *512 -100 = 917449975 -100 = 917449875
My command line now looks as:
dd_rescue -s 917449875b -S 0 -m 200b /dev/sda5 /tmp/sda5
Is this correct?
I got some badblock errors. And, the resulting file /tmp/sda5 is only 42,5 KByte, while
I thought it should be 50 KByte.
>
> Then if that succeeds due to the retry then:
> ddrescue -i <start>b -s <200>b /tmp/$DEVICE /dev/$DEVICE
>
To write back, I used (just changed the files and -s and -S):
dd_rescue -S 917449875b -s 0 -m 200b /tmp/sda5 /dev/sda5
> This should force a re-allocate.
No, it doesnt. I started a short self test and stil get pending sectors. I now get:
1 Raw_Read_Error_Rate 0x000f 099 099 051 Pre-fail Always - 282
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 5
198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline - 1
...
=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed: read failure 20% 2377 1116720298
Yesterday I had only 5 in Raw_Read_Error_Rate and Current_Pending_Sector was 1. Now
Raw_Read_Error_Rate is 282 and Current_Pending_Sector is 5, but Reallocated_Sector_Ct
is still 0. Why does the disk not reallocate the bad sectors?
What can I do to force it to reallocate the bad blocks? Would the program badblocks help me?
Btw, it seems to me that my disk is dying. Am I right?
Regards,
Juergen
______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

I now did the same thing with gnu ddrescue instead off dd_rescue and it worked!
Dont know what went wrong with dd_rescue. Maybe I was to stupid or dd_rescue
was. Anyway, dd_rescue is really a pain.
The only thing I had to change in the commandline of ddrescue was to add the block size
of 4096 (-b 4096). Otherwise blocks would have the default size of 512.
When trying to copy the 200 blocks I got some errors as expected. Some blocks
were not readable at all. After overwriting the 200 blocks I did a fsck which was ok. All
files still seem to be ok.
However, there is one thing I do not understand. After doing all this, Current_Pending_Sector
and Offline_Uncorrectable went to 0, as expected. But Reallocated_Sector_Ct and
Reallocated_Event_Count are also still 0. I thought the drive would have replaced the bad blocks
(5 pending and 1 offline_incorrectable) and thus would display now 6 in Reallocated_Sector_Ct.
Can anyone explain this to me?
Juergen
> -----Ursprüngliche Nachricht-----
> Von: "David Greaves" <david@...>
> Gesendet: 28.06.09 23:22:00
> An: Christian Franke <Christian.Franke@...>
> CC: smartmontools-support@...
> Betreff: Re: [smartmontools-support] pending sector: bad blocks howto doesnt work
> Christian Franke wrote:
> > I prefer GNU ddrescue because of its log file support. It builds OOTB on
> > most platforms.
> Me too.
>
> > The Debian package gddrescue is apparently no longer maintained. It is
> > still at release 1.2, the latest ddrescue release is 1.10.
> oh, thanks for mentioning that, I had no idea :)
>
> David
>
> --
> "Don't worry, you'll be fine; I saw it work in a cartoon once..."
>
______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

Juergen Bausa napsal/wrote, On 06/30/09 09:04:
> However, there is one thing I do not understand. After doing all this, Current_Pending_Sector
> and Offline_Uncorrectable went to 0, as expected. But Reallocated_Sector_Ct and
> Reallocated_Event_Count are also still 0. I thought the drive would have replaced the bad blocks
> (5 pending and 1 offline_incorrectable) and thus would display now 6 in Reallocated_Sector_Ct.
Because of successful write to sector in question the drive decided the
sector is not bad ?
Just guessing ...
Dan

Juergen Bausa wrote:
> I think I understand, what you mean. What I did, is the following:
>
> - installed ddrescue. However, the executable is called dd_rescue. But I think its the
> same program we're talking about
Very similar.
I forgot about that ... there are two and the package with ddrescue is called
gddrescue ... weird.
> dd_rescue -s 917449875b -S 0 -m 200b /dev/sda5 /tmp/sda5
>
> Is this correct?
I tend not to use dd_rescue.... though the principle is the same and it should work.
> I got some badblock errors. And, the resulting file /tmp/sda5 is only 42,5 KByte, while
> I thought it should be 50 KByte.
Yes, you've lost some sectors. Also it suggests your calcs are right!
>> Then if that succeeds due to the retry then:
>> ddrescue -i <start>b -s <200>b /tmp/$DEVICE /dev/$DEVICE
>>
>
> To write back, I used (just changed the files and -s and -S):
>
> dd_rescue -S 917449875b -s 0 -m 200b /tmp/sda5 /dev/sda5
>
>> This should force a re-allocate.
>
> No, it doesnt. I started a short self test and stil get pending
Get a new disk and since your analysis says you're OK you can try doing a
filesystem level copy (I use rsync or similar). If that finishes without error
then you can be fairly confident (and with only 1 badblock in a non-fs area
then....)
Keep an eye out for any dmesg errors... if you get a lot of retries then
consider aborting and using ddrescue which can be easier on the disk since it
copies all the easy stuff off first and then bisects and retries bad blocks.
David
--
"Don't worry, you'll be fine; I saw it work in a cartoon once..."

Juergen Bausa wrote:
>> The safest thing to do is to take the fs offline, calculate a start position a
>> few blocks (100) before then copy off the faulty blocks for, say 200b:
>> ddrescue -r5 -i <start>b -s <200>b /dev/$DEVICE /tmp/$DEVICE
>>
>
>
> I think I understand, what you mean. What I did, is the following:
>
> - installed ddrescue. However, the executable is called dd_rescue. But I think its the
> same program we're talking about
> - syntax of dd_rescue is somehow different:
>
>
GNU ddrescue and dd_rescue are two different and unrelated developments:
http://www.gnu.org/software/ddrescue/ddrescue.htmlhttp://www.garloff.de/kurt/linux/ddrescue/
There is often confusion about that because of the package naming on Debian:
ddrescue is in package gddrescue.
dd_rescue is in package ddrescue,
I prefer GNU ddrescue because of its log file support. It builds OOTB on
most platforms.
The Debian package gddrescue is apparently no longer maintained. It is
still at release 1.2, the latest ddrescue release is 1.10.
Cheers,
Christian

Christian Franke wrote:
>> GNU ddrescue and dd_rescue are two different and unrelated developments:
...
> The Debian package gddrescue is apparently no longer maintained. It is
> still at release 1.2, the latest ddrescue release is 1.10.
>
For future reference, there is a good source of debs for current
versions of GNU ddrescue and an excellent ISO of a live system with all
kinds of very useful recovery tools.
see:
https://help.ubuntu.com/community/DataRecovery
for instructions for their use
and
http://ubuntu-rescue-remix.org/
for links to the ISOs and debs of the tools listed in the the first link.

Christian Franke wrote:
> I prefer GNU ddrescue because of its log file support. It builds OOTB on
> most platforms.
Me too.
> The Debian package gddrescue is apparently no longer maintained. It is
> still at release 1.2, the latest ddrescue release is 1.10.
oh, thanks for mentioning that, I had no idea :)
David
--
"Don't worry, you'll be fine; I saw it work in a cartoon once..."