LinuxQuestions.org
Help answer threads with 0 replies.
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 01-06-2005, 07:42 AM   #1
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
Angry Reformatted ext3 filesystem - recover?


I couldn't find this with Search, and I hope that this is the right forum.

I just executed
mke2fs -T largefile4 -j -F /dev/hdb6
ignoring all warnings (how can a single person be so stupid?!). Unfortunately, /dev/hdb6 is/was my home directory (ext3, with ~35 GiB of data), while I had intended to format /dev/hda6.
I immediately rebooted my computer (after mke2fs completed, but without shutdown), and didn't mount /dev/hdb6 since that accident (I'm currently using Knoppix).

Is there any chance to recover at least parts of my filesystem? grep won't help much since many (important) files are/were binary.


Please help me

Adrian
 
Old 01-06-2005, 09:01 AM   #2
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
As I recall, formatting erases data logically, but not physically. So most of the info IS still there.

But I'm damned if I can remember how to get hold of it again. . .
 
Old 01-06-2005, 11:32 AM   #3
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Original Poster
Rep: Reputation: 31
I just tried to mount the partition, but it tells me something about a bad superblock, so not everything has been overwritten (otherwise mounting should have been no problem).
 
Old 01-06-2005, 01:05 PM   #4
Valindar
Member
 
Registered: Jun 2004
Location: Melbourne, Australia
Distribution: Slackware 9.1
Posts: 33

Rep: Reputation: 15
I have no experience in recovering data, however a quick google yielded some ext2 (ext2 tools work on ext3) recovery tools: http://www.guzu.net/linux/e2retrieve.php
There are links to other programs on that site if those don't suit your needs.

A bad superblock shouldn't matter, as the data would still be there.

Good luck, and post your results, I'm interested in whether it works out or not!
 
Old 01-06-2005, 01:32 PM   #5
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
Quote:
I just tried to mount the partition, but it tells me something about a bad superblock, so not everything has been overwritten (otherwise mounting should have been no problem).
No, that's not the case.
Quote:
A superblock is located at position 0 of every partition, contains vital information about the filesystem and is needed at a fielsystem check.
You didn't physically delete the information in the partition. You destroyed the information that allows you to mount it. That's very different.

Take a look at http://www.brunolinux.com/04-The_Fil...uperblock.html
 
Old 01-08-2005, 03:42 AM   #6
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Original Poster
Rep: Reputation: 31
I have recovered probably 100 % of my data, although there are a lot of directories and files I couldn't associate with their right name (all of them were configuration files of KDE programs).
For those who are interested:
I made a backup of the complete partition, then tried to repair as good as possible:
e2fsck -b 32768 -y backup.copy
mount -o loop backup.copy backup.fs

The file system couldn't be recovered, but all top-level files and directories under my home directory were in lost+found, plus those KDE configuration files.

Thanks for the information about the superblock; unfortunately I couldn't compile e2retrieve.
 
Old 01-08-2005, 05:34 AM   #7
Valindar
Member
 
Registered: Jun 2004
Location: Melbourne, Australia
Distribution: Slackware 9.1
Posts: 33

Rep: Reputation: 15
Cool! Out of interest, what was the problem in compiling e2retrieve? ie. the errors you got, or missing dependancies? It's always good to know the reason why you can't compile something even if you decide not to bother, might help you in the future when you have trouble compiling something else.
 
Old 01-09-2005, 03:04 AM   #8
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Original Poster
Rep: Reputation: 31
'/usr/include/linux/bitmap.h' had undefined preprocessor macros, like BITS_PER_LONG, DECLARE_BITMAP and more. It turned out that these macros were only defined when __KERNEL__ was defined. However, when I defined __KERNEL__, other errors occured (as expected).
Btw. I am using Debian testing.
 
Old 01-09-2005, 06:03 AM   #9
Valindar
Member
 
Registered: Jun 2004
Location: Melbourne, Australia
Distribution: Slackware 9.1
Posts: 33

Rep: Reputation: 15
No clue, I don't even *have* an /usr/include/linux/bitmap.h... ah well. Must be part of a package I don't have.
 
Old 01-09-2005, 09:14 AM   #10
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Original Poster
Rep: Reputation: 31
Maybe you have older (or newer) linux-kernel-headers (e.g. from 2.4).
 
Old 01-09-2005, 11:18 AM   #11
Valindar
Member
 
Registered: Jun 2004
Location: Melbourne, Australia
Distribution: Slackware 9.1
Posts: 33

Rep: Reputation: 15
My kernel headers would be for my current kernel version, as I compile all my kernels myself.
 
Old 01-10-2005, 12:49 AM   #12
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Original Poster
Rep: Reputation: 31
So do I But I do not copy the headers from the Linux sources to my /usr/include.
 
  


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
Trying to recover files with ext3 filesystem bgenora Linux - Newbie 1 11-07-2005 11:54 AM
Recover ext3 ? djib Linux - Software 2 06-09-2005 12:53 AM
Recovering Data From A Freshly Reformatted Ext3 Partition johnleemk Linux - Hardware 1 02-04-2004 01:48 AM
recover files in ext3 hana_abe Linux - Newbie 3 11-16-2003 09:46 AM
filesystem: recover or not to recover? bdp Linux - General 3 06-06-2003 03:40 AM

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

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