LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-05-2008, 08:38 PM   #1
asrael
LQ Newbie
 
Registered: Nov 2008
Posts: 4

Rep: Reputation: 0
restore ext3 after overwritten by swap


Hey

I need some help w/ restoring an ext3 partition. So, this is what happened: given 1 ext3 partition for data and some other hdds; on one of these hdds there is a swap partition. I mess a bit with bios, the order of the hdds changed... reboot, and i find that the order is changed in linux too, data ext3 partition has a new life, as a swap partition.
I swore i would never use path is fstab again (only and only uuid and label), but forgot to change it on this server...
Good thing that "swapon -s" showed that it uses 0 byte on the given partition... bad thing is that it certainly overwritten the partition table

Im running "gpart -W /tmp/backup /dev/sda1" now... will this possibly help? Any other idea? mke2fs -S is my last remedy, i wound not want to use it just yet...

I would really appreciate any answer ^^'

EDIT
gpart result:
Checking partitions...
Ok.

Guessed primary partition table:
Primary partition(1)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

Primary partition(2)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

Primary partition(3)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

Primary partition(4)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

this sux.. thinkin' thinkin'...

Last edited by asrael; 11-05-2008 at 08:44 PM.
 
Old 11-05-2008, 08:57 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 273Reputation: 273Reputation: 273
You can try testdisk. It's worked for me before on something similar.
 
Old 11-05-2008, 09:34 PM   #3
asrael
LQ Newbie
 
Registered: Nov 2008
Posts: 4

Original Poster
Rep: Reputation: 0
no luck, didnt find anything...
next step: mke2fs -S /dev/sda1 -> e2fsck /dev/sda1 ...
 
Old 11-05-2008, 09:53 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,378

Rep: Reputation: 3422Reputation: 3422Reputation: 3422Reputation: 3422Reputation: 3422Reputation: 3422Reputation: 3422Reputation: 3422Reputation: 3422Reputation: 3422Reputation: 3422
This isn't making a lot of sense - unless a mkswap was done somewhere along the way. The swap system will not mount a partition that doesn't have the correct "eyecatcher" that mkswap implants. If mkswap was done, it only write data into the first and eigth sectors IIRC.
gpart is for recovery of partitions, not data in partitions - similarly for testdisk, although the latter is better IMHO.

I just tested this - you might be lucky. I can get to all my files after mkswap, mkfs -S, fsck
 
Old 11-05-2008, 10:04 PM   #5
asrael
LQ Newbie
 
Registered: Nov 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
This isn't making a lot of sense - unless a mkswap was done somewhere along the way. The swap system will not mount a partition that doesn't have the correct "eyecatcher" that mkswap implants. If mkswap was done, it only write data into the first and eigth sectors IIRC.
gpart is for recovery of partitions, not data in partitions - similarly for testdisk, although the latter is better IMHO.

I just tested this - you might be lucky. I can get to all my files after mkswap, mkfs -S, fsck
Now that you point it out, i might have made a mkswap before i realized the order was changed.
fsck is running now, a bit slow (500gb)... and im getting a LOT of "Deleted inode XY has zero dtime. Fix<y>?"
 
Old 11-05-2008, 10:40 PM   #6
asrael
LQ Newbie
 
Registered: Nov 2008
Posts: 4

Original Poster
Rep: Reputation: 0
okey, now im totally f*cked :P
i managed to restore ALL the files... into lost+found.......
i have like a thousand file with the inode no. ...
any tip for this situation?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Data Recovery Ext3 or ReiserFS (since partly overwritten) Dark Carnival Linux - Software 3 01-07-2008 10:04 AM
ext2 ext3 lvm restore Shade00 Linux - Hardware 0 10-20-2005 03:58 PM
Recovering files from ext3 overwritten with reiserfs ReefShark Linux - Software 5 09-22-2005 08:06 AM
ext3 partition table restore pats Linux - General 1 07-22-2005 11:44 PM
ext3 crash - how to restore files? Banderazz Linux - Software 1 05-21-2005 04:18 PM

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

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