Solved

Corrupt Superblock

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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