0

I bought a new raspberry pi and followed a turorial to install the system. I worked on my main PC station and I ran this command:

sudo ddrescue -d -D --force ubuntuXXXX.img /dev/sda

What happened next is I restarted my PC and it said it can not find my main HDD, so it seems I have lost all my data.

Even though I think there is no way to take this back, I still have faith that someone could help me.

I use 500 GB SSD storage, I took it off the PC and when I connect it with an USB cable to another computer, all I see are three partitions, one is 67 MB, other 1.8 GB and the rest seems empty (there should be my data)

1 Answers1

0

You imaged your .img file (which is presumably for the RaPi, and therefore not x86 code) to your hard disk. The partitions that you see now are the ones in the RaPi image.

If you stopped ddrescue before it finished, then it might have only imaged part of the file, but I know from experience that ddrescue runs extremely quickly; even if you stopped it immediately I'm sure it overwrote enough of your system partition that the file system is at least corrupted and probably outright gone. Your files might still be there (and will still be there, past the end of the image size), but the file system metadata that is needed to locate them is gone. Data recovery software could possibly rescue those files (by scanning the disk at the block level, looking for the patterns that indicate the start of document or jpeg or whatever) but the OS is thoroughly trashed.

To get the PC booting (off its hard disk; you could of course use a Live CD or similar) again, your only options at this point are to restore from a backup, or to re-install your PC's operating system (probably repartitioning in the process). Sorry... that's what happens when you run commands as root without being really damn careful.

CBHacking
  • 6,404