LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-07-2016, 09:12 AM   #1
Patric.F
Member
 
Registered: Feb 2010
Posts: 47

Rep: Reputation: 0
Recover lost partition


Ok so this might be one of the biggest mistakes I've ever done.
I was going to install Windows 10 on my computer. And as always I remove every drive before installation except the one that I want to install Windows on. BUT somehow I forgot this time.

When i get to the partitioning step during the Windows installation I remove all the partitions as I always do and create a new partition on the installation-disk. I click next and install.

Everything went fine until I noticed that I had forgot to disconnect my 2TB drive of my ext4 partition with all of my family photos, videos etc.

I fucking panic at this time and notice that I removed the partition and in all the panic I deleted the partition again so the system wouldn't write anything to it.

It appears that the Windows installer made a "System Reserved" partition on my 2TB disk..

I boot up on Linux and run testdisk to see if I can restore the partition.
It appears that it finds my old ext4 partition and I proceed to restore it. It asks me to reboot and when I mount the partition after reboot it's the damn System Reserved stuff of 500MB that is there.....

So now my question is. Can I in some way restore my data or at least parts of my data?
If so, how?

Or am I totally screwed here?

Please, any help is appreciated and I'm freakin' desperate!
My wife will kill me if she finds out.
 
Old 09-07-2016, 09:16 AM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
photorec can help, the data that was overwritten is lost. Hard drives die all the time, what was your plan for a hard drive failure?
 
Old 09-07-2016, 09:26 AM   #3
Patric.F
Member
 
Registered: Feb 2010
Posts: 47

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Emerson View Post
photorec can help, the data that was overwritten is lost. Hard drives die all the time, what was your plan for a hard drive failure?
Thanks, I will try that.
I actually had a valid backup before but it got destroyed. I just got my fiber connection installed and that's was what I was waiting for to upload it on my Google Drive to have it safe..
 
Old 09-07-2016, 10:08 AM   #4
Patric.F
Member
 
Registered: Feb 2010
Posts: 47

Original Poster
Rep: Reputation: 0
Been running photorec for 10minutes now and it has found a bunch of stuff already.
It's estimating it will take 30h.

Is there any way to get the file structure back? The name and hierarchy of the folders?
 
Old 09-07-2016, 11:02 AM   #5
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
I think it is summed up pretty good here.
 
Old 09-07-2016, 06:40 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Quote:
Originally Posted by Patric.F View Post
Is there any way to get the file structure back? The name and hierarchy of the folders?
Short answer - no. The very (meta-)data you need for that is what you smashed.
See the end of @Emerson's post - basic legwork from here on.
 
Old 09-07-2016, 10:25 PM   #7
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Those instructions are for a damaged device with unreadable sectors. What you have is a partially overwritten device.

You restored the partition table, but did nothing to restore the filesystem.

Step 1: Use dd to make a full bit-for-bit copy of the 2TB drive. You may need this because the fsck step below has the potential to destroy all chance of recovery if it goes awry.

Step 2: Run testdisk on copy (or on the original drive if you really trust the copy), select "[Advanced] Filesystem Utils", and then "[Superblock]". Note the block number of the first backup super block that was found.

Step 3: Run "fsck.ext4 -y -b NUMBER" on the copy (or on the original -- same caveat as in Step 2), substituting the number found in Step 2. This is preferable to letting fsck.ext4 discover the backup super block on its own, since there is a small chance it could "discover" the wrong thing.

You should get something back. Some high-level directories will almost certainly be lost, but their subdirectories will show up in lost+found, complete with file names. And of course files in that first 500MB will be damaged or destroyed.
 
  


Reply



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
Need to recover lost partition table business_kid Linux - General 4 03-24-2008 10:42 AM
How do you recover data from lost partition? Exeis Linux - Hardware 9 12-19-2007 04:46 PM
Partition Table Lost...how to recover rhb327 Slackware 5 07-08-2007 08:17 PM
reiserfs partition lost, any way to recover? kostian Linux - Newbie 7 10-29-2004 04:31 PM
Recover a lost partition!!!!! Caveman Linux - Newbie 4 09-26-2003 01:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:38 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