<div dir="ltr">Hi Mike,<div><br></div><div>There is a retrim flag to clear the bad sectors from the existing log. Though this will clear all the bad sectors from the log which is not desirable. The single errors are usually truly errors and the goal is to trim the giant blob of failed sectors to some thing more manageable anyway. You may have to edit the log manually. It is pretty simple, the documentation on their website describes the format. If I remember correctly the format is position, size, status (numbers are in HEX). Find the <a href="https://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html">manual here</a>. Section 6 is the logfile (now known as the map file).</div><div><br></div><div>You can use ddrescueview to see where the bad blocks are distributed on the drive for a more visual idea of what's going on.</div><div><br><div>If it locked at 1 error then just jumped to finish the rest --max-errors=+X may be useful it will stop trying to read the drive after X error(s). I had a drive a while back where it would stop reading the drive completely after the first error and only power cycle would bring it back. That one took nearly 100 attempts to read all the way but I got everything off of it.</div><div><br></div><div>You should also try the read in reverse flag (<span style="color:rgb(0,0,0);font-family:monospace;font-size:medium;line-height:normal">--reverse)</span><span style="line-height:1.5;font-size:13.2px"> if it just gets stuck in the center of the drive.</span></div><div><br></div><div>Using the direct io flag (on v1.20 of ddrescue <span style="color:rgb(0,0,0);font-family:monospace;font-size:medium;line-height:normal">--idirect</span><span style="line-height:1.5;font-size:13.2px">) can help deal with bad sectors as the kernel doesn't handle them (mostly to avoid buffers). I almost always use it when cloning bad drives - it seems to speeds things up and prevents unnecessary retries in reading the media (in theory - I don't know this for sure)</span></div><div><br></div><div>On a side note: I usually clone to file if I can - there is a bit more flexibility with manipulating it though a drive should work well too. (I usually end up doing NTFS recoveries from bad drives over the network with raw images mounted after ddrescue saves all the data)</div><div><br></div><div>Best of luck with this.</div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Sep 13, 2015 at 4:02 PM Mike Miller <<a href="mailto:mbmiller%2Bl@gmail.com">mbmiller+l@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">At about 400 GB I picked up 4 errors, then nothing for a long time.  I<br>
left the house for a while and came back to this, which seems bad:<br>
<br>
$ sudo ddrescue -v -n --force /dev/sda /dev/sdb ddrlog.txt<br>
GNU ddrescue 1.19<br>
About to copy 2000 GBytes from /dev/sda to /dev/sdb.<br>
     Starting positions: infile = 0 B,  outfile = 0 B<br>
     Copy block size: 128 sectors       Initial skip size: 128 sectors<br>
Sector size: 512 Bytes<br>
<br>
Press Ctrl-C to interrupt<br>
rescued:   951404 MB,  errsize:   1048 GB,  current rate:        0 B/s<br>
    ipos:     2000 GB,   errors:      63,    average rate:   49658 kB/s<br>
    opos:     2000 GB, run time:    5.32 h,  successful read:    4.53 m ago<br>
Finished<br>
<br>
It's a 2 TB HDD, so it looks like it did half of it.<br>
<br>
Any opinions on the best next step?<br>
<br>
Mike<br>
<br>
<br>
On Sun, 13 Sep 2015, Mike Miller wrote:<br>
<br>
> Thanks again, Dan.  I ended up starting it before getting your message below,<br>
> but I think I've got it right.  /dev/sdb1 was working and I backed up all of<br>
> it.  /dev/sda1 couldn't be mounted, but they previously were cloned.  So I<br>
> unmounted /dev/sdb, installed GNU ddrescue (on a third drive) and did this:<br>
><br>
> sudo ddrescue -v -n --force /dev/sda /dev/sdb ddrlog.txt<br>
><br>
> After that finishes, I will run this to try to get the bad parts:<br>
><br>
> sudo ddrescue -v -r1 /dev/sda /dev/sdb ddrlog.txt<br>
><br>
> (I'm not sure if I need --force with the second command, but I was forced to<br>
> use it with the first command.)<br>
><br>
> The first command has been running for 45 minutes so far and it reports zero<br>
> errors and 100 MB/s average throughput.  So far, so good.<br>
><br>
> Mike<br>
><br>
><br>
> On Sun, 13 Sep 2015, Dan Armbrust wrote:<br>
><br>
>> On 09/12/2015 03:21 PM, Mike Miller wrote:<br>
>>       Wow, Dan, thanks so much for all the ideas!  This is a huge help. <br>
>> Here's what's going on:<br>
>><br>
>>       I already formatted the new drive with ext4 and copied 3 TB of data<br>
>> onto it, so I don't want to undo all that right away, but there is another,<br>
>> probably more appealing way to go:<br>
>><br>
>>       /dev/sda and /dev/sdb are identical 2 TB drives that were previously<br>
>> in a RAID1.  It looks like sdb somehow disconnected from the RAID, but sda<br>
>> kept working for a few months before it<br>
>>       failed.  I can mount /dev/sdb1 just fine and I copied all the files<br>
>> off of it onto the new external drive.  I had no errors.  So maybe /dev/sdb<br>
>> is in pretty good shape.  Now that it's backed<br>
>>       up, maybe the best plan is to try to copy /dev/sda to /dev/sdb using<br>
>> one of the dd tools.<br>
>><br>
>>       So here's a question:  /dev/sdb is formatted for ext4.  If I want to<br>
>> use it as the destination drive for the dd copy, do I have to use parted to<br>
>> remove the partition table first?  Or what?<br>
>><br>
>>       Thanks again!<br>
>><br>
>>       Mike<br>
>><br>
>><br>
>> You don't have to worry about the partition tables or anything - because<br>
>> rather than copying a partition - such as /dev/sda0 you will just be<br>
>> copying the entire disk - so /dev/sda. <br>
>><br>
>> When you copy the old (failing) disk onto the other disk (that is either<br>
>> the same size, or larger) you will be copying _everything_ - including the<br>
>> partition table, and the formatting info of the file<br>
>> system.  The contents of the disk you are writing to will be completely<br>
>> overwritten.<br>
>><br>
>> So then your replacement disk will be (exactly) what the failing disk was,<br>
>> partition table, labels, filesystem and all.  Though, you will likely have<br>
>> some subtle corruption where blocks that couldn't be<br>
>> read have the wrong bit value. <br>
>><br>
>> So, if you do manage to recover some things - keep in mind that some of the<br>
>> files my have subtle corruption. <br>
>><br>
>> Will you notice if 8 bits are flipped in a 2 GB movie?  Probably not... but<br>
>> you would really just have to test the more important files that you<br>
>> recover to make sure they aren't worse than your several<br>
>> month old backup.<br>
>><br>
>> Dan<br>
>><br>
>><br>
>_______________________________________________<br>
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota<br>
<a href="mailto:tclug-list@mn-linux.org" target="_blank">tclug-list@mn-linux.org</a><br>
<a href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list" rel="noreferrer" target="_blank">http://mailman.mn-linux.org/mailman/listinfo/tclug-list</a><br>
</blockquote></div>