LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Restoring data after a dd command on wrong drive but this drive was previously mounted (https://www.linuxquestions.org/questions/linux-newbie-8/restoring-data-after-a-dd-command-on-wrong-drive-but-this-drive-was-previously-mounted-4175606402/)

Hawezo 05-21-2017 04:38 PM

Restoring data after a dd command on wrong drive but this drive was previously mounted
 
I searched a lot on internet but I didn't managed to get a single thing which could help me. I am totally panicked right now. I am new to Linux and wanted to try out Kali to learn things.

So I was on a LiveCD of Kali trying to install it on a USB Key. The .iso file was on my Windows so I mounted the partition So my sdb1 data was mounted to /root/mnt At this point I used dd to create a bootable USB but I typed sdb instead of sdc...

So what can I do to back up my data I just wiped, if it is even possible?

TLDR I have access to files on a mounted point but the disk that contains them has been wiped up. What can I do to get back the normal partition with the backed up files?

Please help me :'(

rknichols 05-21-2017 05:18 PM

  1. What filesystem was on sdb1? If it was an NTFS Windows partition, you're going to have to use Windows tools to attempt repair.
  2. How large was that partition? (If it was using the whole device, just the size of the device.)
  3. What was the size of the ISO that you copied there?
All of the data that was overwritten by that ISO is forever lost. Depending on the filesystem type and the relative sizes, much of the rest might be recoverable.

Don't do anything that writes to that device without first saving a complete image of, preferably, the complete device, or at least the space occupied by the partitions (the entire partitions) that were touched by that dd operation. When initial attempts at repair do not succeed, they can make matters much worse.

Hawezo 05-21-2017 05:36 PM

Hi,
Thanks for your response.
1. It was in NTFS. It was the secondary drive of my Windows installation (128 Go SSD - which is intact - and 1 To HDD).
2. It was the while thing, 1 To.
3. The ISO was 2.8 Go I think.

I have no external drive, but I'll manage to find one; also, how do I save a complete image of my drive?
Even before I read your answer, I started a tool named EaseUS data recovery. It looks like it found my lost data - I see my whole file hierarchy.
What should I do now?

Also, thanks for your answer and help. It is much appreciated in such panick circumstances...

rknichols 05-21-2017 08:51 PM

You were fortunate that only about 0.3% of that filesystem was overwritten, and the major index structure is apparently intact. The obvious next step is to copy the data you want to save somewhere else. Then, you can repartition and reformat with a new filesystem. Since it appears that you can recover the data without having to write to this drive, there is no need for a backup image, just somewhere to hold your data while you reformat.

Hawezo 05-24-2017 08:25 AM

I managed to have some drive to restore data on, but I can't find any reliable software which can help me recover my data. The one I mentionned before scanned it well but refused to let me recover anything. May you help me on this point? Thank you.

rknichols 05-24-2017 02:10 PM

Apparently you are using the "Free Trial" version of EaseUS, and just shows you what it found without letting you recover anything. This is a Windows NTFS problem, not a Linux problem. You can buy the paid version of EaseUS, look around for other, free NTFS recovery tools, or ask in a Windows support group for advice. I'm at the limit of what I can offer.

Hawezo 05-24-2017 02:11 PM

Oh well, I'll do it with my Google Search skills. Thank you anyway for your advices.

erik2282 05-26-2017 09:57 AM

For Windows, I've always used Recuva.
https://www.piriform.com/recuva

make sure your destination location is as big or bigger than the partition your recovering when using Recuva.

Hawezo 05-26-2017 10:00 AM

Thanks. I'm saving my HDD since yesterday morning thanks to Minitool Power Data Recovery. If it fails, I'll try Recuva out.


All times are GMT -5. The time now is 04:07 PM.