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 - 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 04-21-2010, 12:08 PM   #1
shorty_boy
Member
 
Registered: Oct 2003
Location: Oak Harbor, WA
Distribution: Debian Unstable
Posts: 94

Rep: Reputation: 16
Is it possible to recover from a mke2fs -j /dev/hdxx?


I feel like such a noob. I went on vacation for about a week and came back and realized that my system had rebooted and was at the interactive boot (Probably a California brownout). My UPS is toast and I'm a little bit panicky at this point.

Here is the jist of what happened. It was complaing about the journal on my hdb1 and told me to run fsck.ext3 manually so I did. It started compaining about have a bad super block and all and suggested I use an alternate superblock.

I tried that and all of the other onse to no availe. Either it would compalian again about a bad super block or that the magic number block was incorrect. So I start looking thru man pages for fsck.xt3, e2fsck, and mke2fs.

Basically, since it would not mount as an ext3 fs because a bad journal and trying e2fsck to fix it, I tried to mount the drive as an ext2 thinking that it would ignore the borked journal, wrong. I could only see a lost and found folder with nothing in it. The drive reported that it had ~ 8gb free (which was right) but I could not see any of it.

So I thought I understood enough of what I was trying to do so I tried to research how to recreate the journal and I looked at a post that had the same issue as me. Well some smart people suggested to try mke2fs -j /dev/hdxx and that it would rebuild the journal and all should be well as long as data had not been written to the drive since the borked journal.

Well now, I have and hd that stated that it only has 137mb of data written to it and that it is 0.0% non contiguous (instead of 8.5% with 139 gb written to it.)

I just want to know if I can restore my data because this was my only backup/long term storage device. I cut and paste the things that I don't need on my everyday hd (Now I will use rsync).
 
Old 04-21-2010, 12:37 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
In principle, at least some data is recoverable. When you format with a filesystem, it simply sets up the infrastructure on the disk--it does not overwrite every byte. The most often cited tool is "photorec"--available here:
http://www.cgsecurity.org/wiki/PhotoRec

You will need to be running from a different partition--ideally from a different physical drive, and you will need space (not on the "problem" drive) to put whatever files are found. If nothing else, buy a large USB external drive--when it's all over, use the external for backups.
 
Old 04-21-2010, 02:38 PM   #3
shorty_boy
Member
 
Registered: Oct 2003
Location: Oak Harbor, WA
Distribution: Debian Unstable
Posts: 94

Original Poster
Rep: Reputation: 16
Thanks for the info. I have been looking into testdisk and photorec. I had no luck with testdisk but I have read that photorec has issues with files larger than 30-50mb. This is because it fragments files.

I will start freeing up space on one of my barrowed hds. Now would it be best to dd the formated hd to an image and work from the image or work directly from the srive. I am going to do a byte for byte copy of the drive before i work on it.
 
Old 04-23-2010, 05:53 PM   #4
shorty_boy
Member
 
Registered: Oct 2003
Location: Oak Harbor, WA
Distribution: Debian Unstable
Posts: 94

Original Poster
Rep: Reputation: 16
I am about to plunge into the world of sleuthkit, foremost, scalpel, and testdisk. Wish me luck!. Also, backup your data the right way kids, m'kay!

Last edited by shorty_boy; 04-23-2010 at 05:55 PM.
 
Old 04-23-2010, 07:27 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Work from an image - you can always recreate the image from the original again when you screw up the image.
Be aware that for uncommitted journal entries you have potentially partially updated files on disk. Interpret that as corrupt. Which you don't know about, and which you'll never be able to determine.
Which might not be a problem, or might bite you at some indeterminate time in the future.

When I had similar (lightning prone area) I threw *all* the data away as I couldn't trust it. Hard way to learn the value of backups.
 
Old 04-23-2010, 07:50 PM   #6
shorty_boy
Member
 
Registered: Oct 2003
Location: Oak Harbor, WA
Distribution: Debian Unstable
Posts: 94

Original Poster
Rep: Reputation: 16
Thanks for the insight.
 
  


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
grub-install - old install has lost /dev/hdxx Peit Linux - Software 3 08-28-2006 09:28 AM
mke2fs /dev/fd0 is not being recognized TSynergy Linux - Newbie 2 03-26-2006 01:53 AM
/dev/hdxx = partition name rblampain Linux - General 2 08-02-2005 11:27 PM
mke2fs -j /dev/dvd tytus Linux - Hardware 0 02-16-2005 08:17 AM
mke2fs -c -c -j /dev/hda* ? shanenin Linux - Software 4 03-30-2004 10:04 AM

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

All times are GMT -5. The time now is 01:18 AM.

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