[lug] superblock erased by windows. Help!

David Morris morrisde at frii.com
Mon Feb 26 21:51:58 MST 2001


A tip from someone who has spent time playing arround with
superblocks, and even gone through the emergency of restoring the
primary superblock.  The easiest way to run recovery options is to
bring the hard disk to another (working) linux computer, and examine
the hard disk while it is read only, to avoid  messing up your data.
Once you have found a solution, then run the fix allowing the program
to make changes.

The ext2 file system creates spare superblocks just in case the
primary superblock gets correpted....as seems likely in this case.
The easiest way to get these superblocks when initializing the
partition, but there are other ways to get the alternate superblocks.

As a last ditch method, you can run mke2fs on the partition with the
-S option, and any other parameters you specified when you initialized
the partition.  This will only recreate the superblocks, but should be
used only after all else fails!

If anyone on the list knows of an easier way to get alternate
superblocks, please pose it....but here is a method I know works:

Retrieve the list of block groups:
    # dumpe2fs /dev/hda1 | grep Group

Superblocks are stored at block 0 (the primary), and of the second
block of a few block groups throughout the disk.  So for a listing of
groups:

    Group 0: (Blocks 0 -- 32767)
    Group 1: (Blocks 32768 -- 65535)
    Group 2: (Blocks 65536 -- 98303)
    Group 3: (Blocks 98304 -- 131071)
    Group 4: (Blocks 131072 -- 163839)
    Group 5: (Blocks 163840 -- 196607)
    Group 6: (Blocks 196608 -- 229375)
    Group 7: (Blocks 229376 -- 262143)
    Group 8: (Blocks 262144 -- 294911)
    Group 9: (Blocks 294912 -- 327679)
    ...

Run dumpe2fs, with the second block of each group above, and see if it
gives valid output.  For Group 4, where I found a valid alternate
superblock, I used the command:

    # dumpe2fs -h -ob131073 /dev/hda1

Once you know where your alternate superblocks are, you can use the
`e2fsck -b131073 /dev/hda1` to use the alternate superblock.  If you
are not running e2fsck with the partition read only, e2fsck will
restore the primary superblock with the contents of the laternate.

Hope this helps!

--David

On Mon, 26 Feb 2001, Jesus Molina wrote:

> 
> Hello,
> 
> 
> I am using lilo ina a pentium 3 Intellistation, I have 
> 
> win 98 in /dev/sda1, partition id 6 (DOS 16-bit >=32M
> linux native in /dev/sda2  id 83 (Linux native)
> swap in /dev/sda3	id 82 (Linux swap)
> WIN 95 FAT32(LBA) in /dev/sda4 id 0c, for storing windows data
> 
> After runnig a mpg in windows, my computer crashed
> I cannot boot linux anymore. Lilo works, but linux does not finf
> init.
> 
> Booting  Using TOMsrtbt, and running fdisk:
> 
> VFS: Wrong blocksize on device 08:00
> VFS: Wrong blocksize on device 08:00
> LL_RW_BLOCK: DEVICE 08:00: only 512-char blocks implemented (1024)
> 
> Trying e2fsck
> e2fsck: Bad magic number in super-block while trying to open /dev/sda2
> 
> I have really important data in that partition. So i will truly appreciate
> any help in recovering ot.
> Anyway, How It comes that win98 can crash linux only trying to run a
> video?
> 
> Thanks,
> 
> Jesus
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> 
> 




More information about the LUG mailing list