LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-22-2005, 10:42 AM   #1
edesmarais
LQ Newbie
 
Registered: Nov 2003
Location: Worcester, MA
Distribution: Slackware 10.2/SuSE 10.1
Posts: 25

Rep: Reputation: 15
Fixing ext2/3 partitions


I have a secondary hard drive with 3 partitions. All three partitions were formatted as ext3 and in linux show up as hdb1, hdb5, and hdb6, respectively. Suddenly, out of nowhere, I can no longer mount hdb5 or hdb6, but I CAN mount hdb1. I think that there may be some corruption in the partition (i.e. bad superblock maybe?). I was wondering if there are any tools I can get (linux or windows based -- I don't care at this point) to fix the partitions so I can safely get my data off of them. I would appreciate it greatly.

For the record, I have tried reading the partitions with the following with no luck:

1) Fedora Core 3 (original format took place at this time)
2) Fedora Core 4
3) Gentoo 2005.1 (where I noticed the problem)
4) Windows 2k with Ext2Fsd (still only reads first partition on drive)

Oh, and hdb5 and hdb6 are part of the extended partition hdb2.

Thank you,
Evan
 
Old 10-22-2005, 01:18 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,865

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
"I was wondering if there are any tools I can get (linux or windows based -- I don't care at this point) to fix the partitions so I can safely get my data off of them."

You can use fsck to fix an umounted file system. The commands are:

fsck -t ext3 /dev/hdb5
fsck -t ext3 /dev/hdb6

Answer y to any question fsck asks. If the problem turns out to be complicated then read:
masn fsck

------------------------------------
Steve Stites
 
Old 10-22-2005, 03:55 PM   #3
edesmarais
LQ Newbie
 
Registered: Nov 2003
Location: Worcester, MA
Distribution: Slackware 10.2/SuSE 10.1
Posts: 25

Original Poster
Rep: Reputation: 15
Ok, I'm a true idiot. I did a little poking around and found that what I must have done is accidentally formatted the ext3 drive as reiserfs when I installed gentoo. Now, apparently there were no other changes made to hdb than the reiser format (gentoo was installed on hda). So to complicate things a bit, does anyone know how to unformat the reiserfs and get my ext3 w/data back? Or is this impossible?

Thanks for taking the time to help a moron.

Evan
 
Old 10-22-2005, 05:16 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,865

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
"what I must have done is accidentally formatted the ext3 drive as reiserfs when I installed gentoo. Now, apparently there were no other changes made to hdb than the reiser format (gentoo was installed on hda). So to complicate things a bit, does anyone know how to unformat the reiserfs and get my ext3 w/data back?"

I am unsure of the sequence of events. If you formated hdb5 and hdb6 before you created the files on hdb5 and hdb6 then your problem is easy to fix. Change /etc/fstab to describe /dev/hdb5 and /dev/hdb6 as reiserfs and reboot.

If you formated hdb5 and hdb6 after you created the files on hdb5 and hdb6 then you have lost the files. Change /etc/fstab to describe /dev/hdb5 and /dev/hdb6 as reiserfs and reboot. Then check to see if the files are there. If not you will have to restore the files from backup.

--------------------------
Steve Stites
 
Old 10-22-2005, 05:49 PM   #5
edesmarais
LQ Newbie
 
Registered: Nov 2003
Location: Worcester, MA
Distribution: Slackware 10.2/SuSE 10.1
Posts: 25

Original Poster
Rep: Reputation: 15
Sequence of events is as follows:

1) Install Fedora. In this process I created all of the partitions and formatted them as ext3.

2) Loaded up hdb6 with a bunch of files that would be nice to have at this point.

3) Fedora didn't work out so well, so I tried Gentoo. I made sure not to format anything in hdb, but I think I screwed up, because now hdb5 and 6 are both reiser (according to linux and windows) instead of their original ext3. Hdb1, however, stayed ext3, oddly enough.

Now I can't read the data from hdb6. I have not tried to write data to this seemingly empty drive.

I assume this means I'm screwed. There has to be some way to undo this.
 
Old 10-22-2005, 08:33 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,865

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
"I assume this means I'm screwed. There has to be some way to undo this."

I don't know of any way to recovery the lost files. I used Google to find this site:

http://www.data-recovery-software.ne...html/?GGLAW070

I have no idea if this software works or if it will work after the ext3 file system has been formatted to reiserfs.

------------------
Steve Stites
 
Old 10-29-2005, 08:09 PM   #7
edesmarais
LQ Newbie
 
Registered: Nov 2003
Location: Worcester, MA
Distribution: Slackware 10.2/SuSE 10.1
Posts: 25

Original Poster
Rep: Reputation: 15
You are my new personal savior! I downloaded that software and am currently in the process of recovering ALL of my data onto a new drive. Thank you soooooooo much! Anyway, for anyone else who reads this thread in the future, here's a semi-complete description of what I did:

Problem: Accidentally formatted an existing ext3 partition (full of data) with reiserfs.

Solution:
1) On a separate physical drive, I installed Win2k and used it as a primary drive.
2) The affected drive (the one I made the stupid mistake with) is hooked up as a slave
3) Download r-tools from www.r-tt.com (it MUST be installed on a windows system strangely enough).
4) Do an r-tools scan on the problem drive.
5) Recover whatever data r-tools finds to another location.

R-Tools actually found data from almost 5 partitions back!


Steve, thanks again!
Evan
 
Old 10-29-2005, 08:12 PM   #8
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
rtt makes excellent software - the only "data recovery" software I've come across that actually works. I'm glad you got your data back. rtt saved us weeks of work once when a Windows MFT went south.
 
Old 11-16-2005, 11:03 AM   #9
shess01
LQ Newbie
 
Registered: Nov 2005
Distribution: Fedora X
Posts: 6

Rep: Reputation: 1
Put another one in the WIN column!

RTT has my vote also. I have crashed partition tables on disks before but I have never seen one look as bad as the crash I had last week. NTPhoenix saved me before but no dice this time. Clean superblocks no longer exist on this drive. RTT see's the files so I will recover them later. Spread the word.
 
  


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
old ext2 partitions should be converted AwesomeMachine Linux - Newbie 4 09-16-2005 12:47 AM
fixing partitions in GRUB aryth Linux - Newbie 12 08-23-2004 12:18 PM
How to get EXT2 on other partitions darkleaf Linux - Software 2 08-19-2004 07:14 AM
fixing my partitions toddncl Linux - General 0 07-12-2004 11:58 AM
fsck crashes fixing ext2 fs echapin Linux - General 2 05-28-2004 11:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:14 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration