I have an old HDD which failed and I'm trying to recover what's possible with testdisk. The plan was to use dd to make an image and then use testdisk to recover files from the image to avoid damaging the disk even more.

I used the following command:

sudo dd if=/dev/sdc of=/mnt/BigDisk/backup.iso status=progress

Everything worked fine until the progress stopped. It didn't go down to 0MB/s it just froze.

I waited for several hours and nothing changed. Then I tryed Ctrl+C out of it, but nothing. In the end I sent it a SIGKILL (sudo kill -9 <pid>) but even this didn't work. I also tried to run different commands like lsblk which also got hung and did not respond to any signal, included SIGKILL. In particular, I think that every process that tried to read or get information on that device got frozen and "unkillable".

The last thing I tried was powering-off my PC but, even then, the black screen with the blinking white bar continued to stay there and my PC never turned off.

The following day I tried using testdisk directly on /dev/sdc. It detected the partition (ext4, there was just one of them) correctly and was able to read file names, but when I started copying, after some files happened the same thing it happened to dd.

Is this some kind of kernel issue?

System Info:

  • OS: Arch Linux, Kernel: 5.13.5-arch1-1
  • /dev/sdc is an HDD with just one ext4 partition on a MBR partition scheme.
  • /mnt/BigDrive is an external drive which had one NTFS partition on it, which also got damaged and now has a similar behavior as the other disk. It was mounted using ntfs-3g.
  • 1
    Have you also tried ddrescue? I have been using that successfully a couple of times. It skips unreadable sectors and should finish eventually.
    – eblock
    Jul 28 '21 at 10:42
  • @eblock yes, I've also tried it but with the same result
    – Billy
    Jul 28 '21 at 10:44
  • 1
    Could you send a bug report to the kernel? Possibly you have found some places (possibly hardware specific) where the kernel is not handling error path correctly. Jul 28 '21 at 13:26
  • 1
    @GiacomoCatenazzi it might, but I have no idea how to do it and I fear to damage my disk even more
    – Billy
    Jul 28 '21 at 15:20

Finally I managed to rescue my files.

I may have lied in the question because probably between the moment I tried the first time and when I posted the question I had a kernel update (probably from 5.12 to 5.13). I tried again yesterday with the new kernel and a new hard drive with an ext4 partition as destination and it worked fine. ddrescue took something like 12 hours but in the end it finished copying with just a few bites of errors.

Thanks everyone for the advice.

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.