I'm trying to recover a damaged partition on a damage hard disk thanks to gnu ddrescue.

I followed ubuntu tuto to do so and let it run all night long, but the 3rd and 4rt commands fail: see the logs of my script bellow:


ubuntu@ubuntu:~$ bash -x rescue.sh

+ INTERN=/dev/sda2
+ TARGET=/dev/sdb1
+ SUIVI=/dev/sdb3
+ sudo mount /dev/sdb3 /media/ubuntu
mount: /media/ubuntu: /dev/sdb3 déjà monté sur /media/ubuntu.
+ sudo mkdir /media/ubuntu/dd

+ sudo ddrescue -f -N -n -b4096 -K524288 /dev/sda2 /dev/sdb1 /media/ubuntu/dd/suivi6
GNU ddrescue 1.23
Press Ctrl-C to interrupt
     ipos:   93098 MB, non-trimmed:   10530 kB,  current rate:       0 B/s
     opos:   93098 MB, non-scraped:        0 B,  average rate:  32564 kB/s
non-tried:        0 B,  bad-sector:    24576 B,    error rate:   21845 B/s
  rescued:  477173 MB,   bad areas:        6,        run time:  4h  4m 13s
pct rescued:   99.99%, read errors:      192,  remaining time:      6h 49m
                              time since last successful read:      1m 30s

+ sudo ddrescue -f -c1 -b4096 /dev/sda2 /media/ubuntu/dd/suivi6
GNU ddrescue 1.23
Press Ctrl-C to interrupt
     ipos:  112395 MB, non-trimmed:        0 B,  current rate:   1179 kB/s
     opos:  112395 MB, non-scraped:        0 B,  average rate:  25915 kB/s
non-tried:        0 B,  bad-sector:    8785 kB,    error rate:       0 B/s
  rescued:  477175 MB,   bad areas:      124,        run time:  5h  6m 52s
pct rescued:   99.99%, read errors:     2145,  remaining time:         n/a
                              time since last successful read:         n/a

+ sudo ddrescue -d -f -R -r27 -b4096 -c1 /dev/sda2 /dev/sdb1 /media/ubuntu/dd/suivi6
ddrescue: error in mapfile /media/ubuntu/dd/suivi6, line 131.

+ ddrescue --fill-mode=- --force --synchronous /dev/zero /dev/sdb1 /media/ubuntu/dd/suivi6
ddrescue: error in mapfile /media/ubuntu/dd/suivi6, line 131.

I checked the mapfile and it contains weird characters:

ubuntu@ubuntu:~$ sed -n 130p /media/ubuntu/dd/suivi6 
0x22D3670000  0x4C46F90000  +

ubuntu@ubuntu:~$ sed -n 131p /media/ubuntu/dd/suivi6 
INDX(   ��_�(8�t�ty�j5ˣ{��N3����N3����N3���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046ra�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{�ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{��ł1����ł1����ł1���1046rat�j5ˣ{�j5ˣ{�j5ˣ{�j5ˣ{�1048rat�

I found no similar error on the web, does somone have any idea?

My configuration

Linux version 5.3.0-18-generic (buildd@lcy01-amd64-027) (gcc version 9.2.1 20190909 (Ubuntu 9.2.1-8ubuntu1)) #19-Ubuntu SMP Tue Oct 8 20:14:06 UTC 2019

GNU ddrescue 1.23

Thank you!


Your second ddrescue command:

sudo ddrescue -f -c1 -b4096 /dev/sda2 /media/ubuntu/dd/suivi6

The target parameter is missing, so the map file is taken as the target and overwritten.

There is no third parameter as mapfile so it does not resume either but overwrites from the beginning.

If your target was a regular file instead of disk partition you could have tried to guess generate a new mapfile with ddrescue --generate-mode but this is not advisable in your situation unless you can guarantee the target drive was fully zeroed before you started the copy. This is a much easier guarantee to make with a target file as new files are zero by nature.

You can either start over (with a different target, best not to touch yours anymore or risk making it worse), or call it a day; you did rescue 99.99% after all, that's not too bad.

Oh hey, I'm an idiot. Your target IS a regular file in the 2nd command. If you haven't modified the suivi6 file you can try to generate the progress from it after all (but you have to preserve this file as that is your image now, not your original target).

See info ddrescue Generate, Generate Mode. And perhaps mv suivi6 sda2.img to give it a less confusing name. (Also check it has the full disk size whereas a regular map file is a small-ish text file).

  • 1
    Thank you so much, if it works I'll fix the ubuntu french wiki doc.ubuntu-fr.org/…
    – Pleymor
    Feb 29 '20 at 8:47
  • However, is it ok to run the next commands with an empty log file (suivi6)?
    – Pleymor
    Feb 29 '20 at 8:53
  • 1
    In generate mode, it's normal for the map file to be empty as it will be generated then. If you're using an empty map file for regular mode, you're essentially starting over from scratch. Which you already did unintentionally and it seems to have worked fine, except of course it took over 5 hours... Feb 29 '20 at 9:06
  • 1
    I'd probably just call it a day here, it likely won't get better than what you already have now on/dev/sda2 from the first run. 99.99% recovery is very good. Feb 29 '20 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.