LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-21-2017, 04:38 PM   #1
Hawezo
LQ Newbie
 
Registered: May 2017
Posts: 5

Rep: Reputation: Disabled
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 :'(
 
Old 05-21-2017, 05:18 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,716

Rep: Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192
  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.

Last edited by rknichols; 05-21-2017 at 05:20 PM.
 
Old 05-21-2017, 05:36 PM   #3
Hawezo
LQ Newbie
 
Registered: May 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
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...
 
Old 05-21-2017, 08:51 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,716

Rep: Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192
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.
 
1 members found this post helpful.
Old 05-24-2017, 08:25 AM   #5
Hawezo
LQ Newbie
 
Registered: May 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
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.
 
Old 05-24-2017, 02:10 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,716

Rep: Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192
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.
 
Old 05-24-2017, 02:11 PM   #7
Hawezo
LQ Newbie
 
Registered: May 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
Oh well, I'll do it with my Google Search skills. Thank you anyway for your advices.
 
Old 05-26-2017, 09:57 AM   #8
erik2282
Member
 
Registered: May 2011
Location: Texas
Distribution: Primarily Deb/Ubuntu, and some CentOS
Posts: 826

Rep: Reputation: 229Reputation: 229Reputation: 229
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.
 
1 members found this post helpful.
Old 05-26-2017, 10:00 AM   #9
Hawezo
LQ Newbie
 
Registered: May 2017
Posts: 5

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
non-mounted Debian wheezy 7.9 on partitioned Hard Drive - wrong screen resolution limited to 1024 x 768 tanguy123 Linux - Newbie 13 01-23-2016 05:14 PM
[SOLVED] second hard drive showing first drive / when mounted newbeliever Linux - Newbie 4 01-11-2015 07:11 PM
Restoring Data From a Drive With IO Errors jsullivan44 Linux - Hardware 1 09-01-2010 10:42 AM
problem while restoring data from tape drive using mt shellarchive Red Hat 1 07-09-2008 10:54 AM
Creating/restoring drive image on USB drive OneSeventeen Linux - Newbie 9 07-06-2005 05:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration