Solved

Corrupt Superblock

Posted on 1997-09-25
5
660 Views
Last Modified: 2008-03-06
I run RedHat Linux 4.1 on a 486 machine with all the usual stuff.  This morning, I had a kernel panic due to a disk error on my boot partition, and now I can't reboot.

I booted from my "rescue" disk, and was able to mount the suspect partition.  When I try to run fsck on it, it tells me that I have a corrupt superblock, and that I should use fsck -b <alternate superblock number> /dev/hda4, and suggested that I try block 8193, a common location for alternate supeblocks.  Unfortunately, that didn't work.

So here is the question:  Is there some way to find out where my alternate superblocks are located?  If not, is there some other strategy to rescue this disk?

Thanks

Justin Harlow
0
Comment
Question by:harlow
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
jlms earned 100 total points
ID: 1633563
Assuming you have a ext2fs filesystem , then try mke2fs -S (see man page first), and the the fsck command.


0
 

Author Comment

by:harlow
ID: 1633564
I looked at the man page for mke2fs -S, and it makes the operation sound pretty scary.  Is that mostly lawyerspeak, or is it probable that I am going to totally hose my files system by trying this?  I realize that nothing is certain in messing with filesystems, especially corrupt ones, but what's your guess as to the odds of success here?

I am curious about the algorithm used to decide where to hide backup superblocks (right... I didn't copy them down when I built the filesystem long ago...)  Where is this documented for e2fs?  I'd like to try to figure out where my duplicates are, and use e2fsck -b before I risk blowing the whole thing away.

Thanks

JEH

0
 
LVL 4

Expert Comment

by:jlms
ID: 1633565
Well, my Linux says it just show things without actually afecting anything, I will check later because my Linux box is not here now.  My guess is than most of the times one gets this problems the posibilities of loss are unfortunately high :(


0
 
LVL 4

Expert Comment

by:jlms
ID: 1633566
Sorry, you have reason to be scared, this command actually rewrites things (without modyfing inodes), and as the man page says, is practically the last resource.
In Linux I have not done something of this sort; with other UNIXes it works and most times allows you to make some recovery work. Dont forget to make a filesystem check after this.

0
 

Author Comment

by:harlow
ID: 1633567
Thanks.  I have sort of readched the same conclusion, namely, that my partition is hosed beyond salvage.  I was not even able to run mke2fs -S, which is supposed to rewrite the superblock and leave the inodes alone.  It aborts, saying that there is no file or directory called "stat".  The documentation is silent on what that file might be, or where it is supposed to be.  Even if this were to work, I think I am still stuck, because a lot of the kernel panics I get involve the inability to read certain specific inodes.  That is probably not totally a superblock problem.

As it stands, I have been able to mount the bad partition, and have successfully copied off almost all of its contents to another disk.  Unfortunately, the parts I cannot copy are /etc and parts of /var, so a full restoration is probably not likely even after reformatting the partition.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question