LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-25-2005, 06:44 PM   #1
kr5
LQ Newbie
 
Registered: May 2005
Posts: 10

Rep: Reputation: 0
Bad SuperBlock! How to recover data?


Ok, so we had a brownout, and now I have a 160GB SATA hard drive that is giving errors and will not boot. The first partition is fine and grub loads correctly, but there are some errors on the 2nd partition where all the data is.

I put the drive in another linux machine and the parition in qiestion is /dev/sdb2.

when running a fsck I get this:
----snip
[root@underdog ~]# fsck.ext3 /dev/sdb2
e2fsck 1.35 (28-Feb-2004)
Couldn't find ext2 superblock, trying backup blocks...
fsck.ext3: Bad magic number in super-block while trying to open /dev/sdb2

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
snip----

So Since I dont know where the alternate super blocks are, I run mke2fs:

--snip
[root@underdog ~]# mke2fs /dev/sdb2
mke2fs 1.35 (28-Feb-2004)
max_blocks 4294967295, rsv_groups = 0, rsv_gdb = 1024
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
19415040 inodes, 38807015 blocks
1940350 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=41943040
1185 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
---snip

So at this point I try "e2fsck -b $eachaltblock /dev/sdb2" for each one of the backup super blocks but still get an error:

---snip
[root@underdog ~]# fsck.ext3 /dev/sdb2
e2fsck 1.35 (28-Feb-2004)
Couldn't find ext2 superblock, trying backup blocks...
fsck.ext3: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdb2
Could this be a zero-length partition?
snip---


Is my data toast?

Any help is greatly appreciated!

Last edited by kr5; 07-25-2005 at 06:55 PM.
 
Old 07-25-2005, 09:45 PM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
WHY did you run mke2fs?

I can't imagine why that would be done. You formatted the partition. Data recovery just went way beyond superblock issues.

Originally, e2fsck -b 8193 <device> might've worked. Additionally, for larger partitions, it becomes 16k or 32k. When you recreated it, it seems it was 32768.
 
Old 07-25-2005, 10:11 PM   #3
kr5
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
i ran mke2fs -n that only kicks out the backup superblocks, i missed that in the message above. Also I had already tried all the backup superblocks to no avail.
 
Old 07-25-2005, 10:15 PM   #4
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
AH, ok. Sorry. Was just quite surprised to see that.

None of them work? That's not a good sign... *duh*

Try running 'dumpe2fs /dev/sdb2'
 
Old 07-25-2005, 10:17 PM   #5
kr5
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
[root@underdog ~]# dumpe2fs /dev/sdb2
dumpe2fs 1.35 (28-Feb-2004)
dumpe2fs: Bad magic number in super-block while trying to open /dev/sdb2
Couldn't find valid filesystem superblock.
 
Old 07-25-2005, 10:23 PM   #6
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
I guess that ended that experiment quickly.

The disk was ext2/ext3, right?
 
Old 07-25-2005, 10:28 PM   #7
kr5
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
yes sir, it was in another machine so it was using software raid (LVM?).
 
Old 07-25-2005, 10:29 PM   #8
kr5
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
and fdisk says the partition appears to be normal. or at least it does not report corrupption or unexpected cylander errors.
 
Old 07-25-2005, 11:00 PM   #9
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
there was LVM on the partition? LVM sets up all kinds of other things. the LVM didn't span multiple partitions or anything, did it?

You *MAY* be able to use vgscan to try to get it back up and running. I'm not too familiar with LVM, only md/software raid.
 
Old 07-26-2005, 12:05 AM   #10
kr5
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
i will look into it tomorrow. Thanks for the tips!
 
Old 08-02-2005, 10:49 AM   #11
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,153

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
I have a very similar problem: Can't mount /dev/mapper/vg_v because of "invalid superblock" for all the superblocks listed by mke2fs -n.

But I just tried debugfs on /dev/mapper/..., and I can at least recover some of the data.

So, I suggest you give it a try. After I backup the home directories, I'll see if debugfs can "fix" the bad superblock info.
 
Old 08-02-2005, 01:14 PM   #12
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 257

Rep: Reputation: 36
I had a similar issue;

i was getting a superblock error just like yours on /var (on it's own partition).

tried many, many things, but there was nothing that worked.

as a last resort i found some references to the gpart program and tried it. lo and behold
it worked (it looks at the actual inodes on the disk and re-writes the partition table).

i wouldn't try this until you've saved any data that you can get.

good luck!
Danimal
 
Old 08-02-2005, 03:00 PM   #13
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,153

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Well, I finally figured out the the journal file was "bad," so I used debugfs to remove the journal file (thus, of course, converting my fs from ext3 to ext2) and I can now mount the fs!

Of course, this is all from my "back-up" installation. When I finish dumping the stuff I want to save, I'll see if I can reboot the system where the "bad" fs is root.

Oh, I did try recreating the journal file, and got the "bad superblock" message trying to mount. Perhaps that disk section is bad. At some point (again, after the dump finishes) I'll see if I can create the journal file somewhere else. (Or, more likely, get a new disk drive.)
 
Old 08-02-2005, 05:18 PM   #14
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,153

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Either GRUB or the boot image expects an ext3 file system, and I get a kernal panic when I try to boot with the (now) ext2 root fs. I suppose I could figure it out, but I think, at this point, I'll just wipe the partition, recreat it, and restor it from my (currently running) dump file.

As an aside, why does dump have an output file size limit built in? It seems to think that my -f <file> is pointing to a tape drive. Strange.
 
Old 08-04-2005, 08:37 AM   #15
kaitv
LQ Newbie
 
Registered: Aug 2005
Posts: 1

Rep: Reputation: 0
---snip
Well, I finally figured out the the journal file was "bad," so I used debugfs to remove the journal file (thus, of course, converting my fs from ext3 to ext2) and I can now mount the fs!
--- snip

Exactly how did you do this? I am desperately trying to save data on a disk that got just this problem, but cannot find how to use debugfs to remove the journal file.

Any input would be greatly appreciated.

cheers,

kai
 
  


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
mount: wrong fs type, bad option, bad superblock on /dev/hdc3 Lordandmaker Linux - Hardware 15 06-05-2011 09:55 AM
mount: wrong fs type, bad option, bad superblock on /dev/cdrom, Adil_uk Linux - Hardware 9 02-16-2005 06:50 PM
bad superblock, corupt data, dd, Oh my! veroth Linux - General 2 03-17-2004 11:55 AM
mount: wrong fs type, bad option, bad superblock on /dev/sdb1 pmoreira Linux - Hardware 5 02-26-2004 11:31 AM
wrong fs type, bad option, bad superblock on /dev/hdb1, ldare Linux - Hardware 1 02-12-2004 10:03 PM


All times are GMT -5. The time now is 07:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration