Solved

Corrupt Superblock

Posted on 1997-09-25
5
648 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
  • 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now