Click to See Complete Forum and Search --> : hard drive fail -- bad superblock


sb
10-28-2002, 02:25 PM
Hello,

I've had a computer lock up and we had to reboot via the power switch. Upon reboot the system failed to recognize /home. In rescue mode the fsck.ext3 software indicates that there was a bad superblock on the partition.

I tried using fdisk to wipe out the partition and then used fdisk to build the partition again (I printed the block summary with "fdisk -l /dev/hda")

Nothing seems to help. Does anyone have an idea how we can save this system? I don't think that there is any way that I can mount this hard drive on a second PC since there probably still is a bad superblock on the partition.

We're running redhat 7.3 on an athelon. The filesystem is formated to ext3.

Thank you,

mdwatts
10-28-2002, 06:15 PM
fsck.ext3 -b /dev/hda#

Replace # with the actual partition number.


-b superblock
Instead of using the normal superblock, use an alternative superblock specified by
superblock. This option is normally used when the primary superblock has been cor_
rupted. The location of the backup superblock is dependent on the filesystem's
blocksize. For filesystems with 1k blocksizes, a backup superblock can be found at
block 8193; for filesystems with 2k blocksizes, at block 16384; and for 4k block_
sizes, at block 32768.

Additional backup superblocks can be determined by using the mke2fs program using the
-n option to print out where the superblocks were created. The -b option to mke2fs,
which specifies blocksize of the filesystem must be specified in order for the
superblock locations that are printed out to be accurate.

If an alternative superblock is specified and the filesystem is not opened read-only,
e2fsck will make sure that the primary superblock is updated appropriately upon com_
pletion of the filesystem check.

sb
10-29-2002, 10:43 PM
How do I determine the filesystem's
blocksize?

Can I use "fsck.ext3 -B /dev/hda6" to search for an alternative block?

mdwatts
10-30-2002, 07:22 AM
Originally posted by sb
How do I determine the filesystem's
blocksize?


I'm not sure.


Can I use "fsck.ext3 -B /dev/hda6" to search for an alternative block?

Did you first try with '-b'?


-B blocksize
Normally, e2fsck will search for the superblock at various different block sizes in
an attempt to find the appropriate block size. This search can be fooled in some
cases. This option forces e2fsck to only try locating the superblock at a particular
blocksize. If the superblock is not found, e2fsck will terminate with a fatal error.

sb
10-30-2002, 12:43 PM
I thought that I erased my second post...

When I tried "mke2fs -n /dev/hda6" it printed a list of alternative superblocks.

I then ran "fsck.ext3 -b 32768 /dev/hda6" (32768 was the first alternative superblock listed).

fsck.ext3 bounded lost files to /home/lost+found and rewrote the superblock so everything works.

Your reply to my first post worked wonderfully.

Thank you,
Scott

mdwatts
10-30-2002, 06:48 PM
Glad to help and to see you got it fixed. :)