Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unformat ext2/3
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
zen_guerrilla
Guru
Guru


Joined: 18 Apr 2002
Posts: 343
Location: Greece

PostPosted: Mon Nov 18, 2002 12:01 am    Post subject: Unformat ext2/3 Reply with quote

Hello world,
I accidentally run mke2fs -F -v /dev/hdf1 instead of fsck -f -v /dev/hdf1 and wiped that partition. Is there anyway to "unformat" it or should I hang myself ?

.:: zen ::.
Back to top
View user's profile Send private message
MaD-DaRiUs
n00b
n00b


Joined: 21 Aug 2002
Posts: 46
Location: BC, Canada

PostPosted: Mon Nov 18, 2002 2:56 am    Post subject: Reply with quote

well i would say you'd best hang yourself :wink:

when you format your basicly rearranging everything on that partition so any data you had is gone as far as i know.
if you had just repartitioned then it would be possible to recover.
but i'm not 100 percent sure on this you might try an extensive google
search on filesystem recovery and the like
_________________
Required Reading list.
http://www.catb.org/~esr/faqs/smart-questions.html
http://www-106.ibm.com/developerworks/linux/library/l-faq/index.html
http://wiktionary.org
Back to top
View user's profile Send private message
zen_guerrilla
Guru
Guru


Joined: 18 Apr 2002
Posts: 343
Location: Greece

PostPosted: Mon Nov 18, 2002 11:22 am    Post subject: Reply with quote

Actually the files are still there if do i.e. : "grep -b 'gentoo' /dev/hdf1" it replies "Binary file /dev/hdf1 matches" and also "strings /dev/hdf1" shows all the files. However all the files I'm interrested to are binaries and I can't simply copy-paste them using strings. Is there any way to rescue these files ?
I'm beggining the hanging-myself process anyway :)

|
o|
/-\
|
/\

.:: zen ::.
Back to top
View user's profile Send private message
clacour
n00b
n00b


Joined: 19 Apr 2002
Posts: 59
Location: Dallas, Tx USA

PostPosted: Mon Nov 18, 2002 5:09 pm    Post subject: Reply with quote

Make sure you have a drop of at least three feet, and whatever you do, don't use nylon! (It stretches, which means strangulation rather than neck-snapping.)

I'm afraid you're completely S.O.L. Here's why:

In a normal, working filesystem, directory entries (the things you see when you do an "ls") point to inodes, which contain some information about the file (the stuff you see when you do an "ls -l", rather than an "ls") and most importantly, pointers to the data blocks that contain the actual file. (For small files, the inode might contain the data itself. I'm not too sure about that point; my memory is fuzzy on that subject.)

When you rebuilt the filesystem, you wiped out every one of the inodes, replacing them with the standard contents of an "empty" inode.

File recovery utilities are designed to rebuild the directory file, and operate on the assumption that the inode is intact, it's just the pointer to it (aka the directory entry) that's missing.

You're one layer below that, unfortunately.

Searchable things like text might be mostly recoverable, but binaries are almost certainly gone forever.

You might want to post more info on what the partition was in it's previous life, and get suggestions on how to most easily recover what you had. Getting it off /dev/hdf1 is not going to be one of those options, I'm afraid.
Back to top
View user's profile Send private message
zen_guerrilla
Guru
Guru


Joined: 18 Apr 2002
Posts: 343
Location: Greece

PostPosted: Mon Nov 18, 2002 5:24 pm    Post subject: Reply with quote

I've officially comitted suicide, and this is my ghost replying :)
Anyway, I searched a little bit about it and there's nothing I can do ("semi-official" redhat ext3-dev response to ml). The only things that I didn't have back-up'd were some university papers from previous years but I can get them hard-copied from the teachers any time I' ll need them, so it's ok.
It was a good excuse anyway to convert that partition to reiserfs too ;)
Thanx for replying though.

.:: zen ::.
Back to top
View user's profile Send private message
saru
n00b
n00b


Joined: 31 Oct 2006
Posts: 11

PostPosted: Tue Oct 31, 2006 9:29 pm    Post subject: Recover from accidental format Reply with quote

I've accidentally formated (quick format) my data partition while installing (I must have missed that the format flag was set). It used to be a FAT32 partition and is now an EXT3 partition. Running some "data recovery" software I was able to get some file back, but not most of the newer ones (I'm thinking it's due to the files being fragmented all over the disk).

Is there any way I can undo this, or are the discriptors lost forever and "data recovery" software is the best I can get?

Thanks a bunch for replies
Back to top
View user's profile Send private message
timeBandit
Bodhisattva
Bodhisattva


Joined: 31 Dec 2004
Posts: 2719
Location: here, there or in transit

PostPosted: Wed Nov 01, 2006 2:30 am    Post subject: Reply with quote

The first copy of the ext3 superblock, plus any other structures at the head of the partition, almost certainly whacked the FAT, possibly both copies. There are two copies of the FAT stored one behind the other, so a FAT recovery tool might be able to replace the first copy from the second, if the ext3 structures didn't clobber both copies. Sorry, it's been so long since I repaired a FAT partition that I can't recall the details--with the right info you can clone the FAT with just dd. Try Google, there's definitely at least a crude HOWTO out there for this.

mke2fs writes backup superblocks in several locations throughout the partition, so even if you recover tha FAT, you've likely lost some data. If a superblock happened to overwrite a directory, everything in it will be orphaned, but a FAT filesystem check tool would probably discover this and recover the chains. If you can fix the FATs themselves using dd or similar, fsck or (better) Windows ScanDisk might be able to undo most of the remaining damage.

Good luck, you'll need it. :(
_________________
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum