LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-18-2007, 05:31 PM   #1
jhoggatt
LQ Newbie
 
Registered: Feb 2007
Location: Texas
Distribution: Fedora 3, Fedora 12
Posts: 6

Rep: Reputation: 0
need to recover from disk partion info being overwritten


one of my sysadmins managed to write data, a tar file, starting at block 0 of the boot disk. This FC3 system has been running smoothly for over 2 years. I used dd command to read the first 512 bytes of data. This is where I expected the Master Boot Record to be written. What I found was data related to the tar file being written.
What I have done:
1, used dd to systematically copy 10GB chunks from the corrupt disk to another system.
2, tried mkpart on the corrupt disk in efforts to mount the disk.
3, also tried mk2fs -S, e2fsck.ext3, cautiously used parted without the guts to save changes.
3, dd_rescue and dd_rhelp did not seem to help me.

What I want is recory of specific files. Our backup procedure was inadequate and some significant files were changed and not backed up.
OK, what I really want is full recovery of all files but will take what I can get.
I am confident that all my data and file are still available, I can see them in the files created from dd.
At some point I must rebuild and start over but I figured a recovery effort was worth the time and effort. So far I have not been sucessful.
I may resort to using file type pointers to help identify specific files like MySQL DB's, tar, gz, etc.
Any help, pointers, tools, advice will be greatly appreciated.
 
Old 02-18-2007, 08:21 PM   #2
libkarl2
LQ Newbie
 
Registered: Feb 2007
Distribution: Fedora 6, OpenBSD 4, Slackware 11
Posts: 3

Rep: Reputation: 0
Documentation.

It sounds to me like not only did your partition table get nuked, but possibly one or more block groups, and god knows what else.

Page 29 of the Filesystems-HOWTO will show you what the physical layout of the e2fs looks like. Alot of critical filesystem control info should still be there, but first...

If you have an image of the original partition table (output from fdisk -I or better..) in your documentation somewhere then you will be able to rebuild the partition table "by hand" as it were. See Partition-Rescue HOWTO, but beware; last update was 2003. It might still be helpful though.

I don't know how to cope with the 'front end' of your filesystem getting tar'ed all to fsck. I have only recovered partitions by rebuilding their partition tables. After that, everything reappeared for me. You may have missing magic numbers or other fs type meta-data that needs POKED in by hand. Eeekk!

I'm hoping that someone more up to date than I am will direct us both to a utility or tool that works better than my crusty old hacks.
 
Old 02-18-2007, 08:26 PM   #3
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
Unfortunately once a sector has been physically overwritten, recovery is unlikely without hiring a professional data recovery service (and even then, the results aren't guaranteed)

If you had (for example) a 2G file that you wrote to (say) a 40G drive, then whatever occupied the front 2G would be lost, but the other 38G (that wasn't overwritten) would still be there (although all directory pointers to it would be lost). Out of curiosity, how big was the tar that was inadvertently copied, and what's the size of your drive?

As for tools, you might want to try foremost. Good luck with it
 
Old 02-18-2007, 09:57 PM   #4
jhoggatt
LQ Newbie
 
Registered: Feb 2007
Location: Texas
Distribution: Fedora 3, Fedora 12
Posts: 6

Original Poster
Rep: Reputation: 0
the drive in complete disarray is /dev/hda, 80GB
the tar file used in corruption is about 45MB.
So that leaves me with highly important filesytem data gone. However, I surmise the rest of the 45M is going to be a lot of generic data from the initial install. I beleive all the *real* files I want to recover have not been destroyed.
As for foremost I have it and used it. The conf file supports a lot of file types I am not interested. Although, it seems possible to add patterns I have not spent enough time to fully understand it well enough. If you have some pointers, please share them.
 
Old 02-27-2007, 10:14 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Any progress here?
 
Old 03-01-2007, 02:18 PM   #6
jhoggatt
LQ Newbie
 
Registered: Feb 2007
Location: Texas
Distribution: Fedora 3, Fedora 12
Posts: 6

Original Poster
Rep: Reputation: 0
I have made a copy of the disk using dd. I cut the dd ouptut files into 10GB files. At some point I may be smart enough to figure out how to extract the files I need/want. I tried 'foremost' but did not get the results needed. In the interest of time, need for the server and the risk of not being able to recover anything I rebuilt using FC6.
Any advice on extracting MySQL DBs, gzips, tarballs, etc from the dd files would be greatly appreciated.
Thanks for the follow up.
 
Old 03-01-2007, 04:59 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If I understand you correctly you have copied the whole disk in 10GB chunks, right? Working on the chunks obviously won't work since it cuts off files. Do you have enough storage capacity to resurrect that disk image from the chunks and enough spare storage to extract stuff (1.5 to 2 times the total disk size) (but most of all: time)?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shrinking RAID 1 partion on 2nd disk simonb1975uk Slackware 3 12-04-2006 06:58 AM
how Recover my Hard disk Mbr & partion viji2ks Linux - Hardware 1 09-01-2006 08:25 AM
Help!!! Disk Partion Repost! GLDarkKnight Linux - Newbie 3 10-06-2005 04:01 PM
Hopfuly right part (Disk Partion) GLDarkKnight Linux - Software 2 10-06-2005 02:11 PM
Cannot partion linux disk chuchaz Linux - Software 3 06-15-2005 09:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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