Bad magic number in super-block (help!)

Bad magic number in super-block (help!)

Post by Andries Brouw » Tue, 19 Sep 1995 04:00:00



: /dev/sda5         786     786    1086  308224   83  Linux native
: /dev/sda6        1087    1087    1487  410624   83  Linux native
: /dev/sda7        1488    1488    1888  410624   83  Linux native
: /dev/sda8   ?  198406  198665  857117674254724   a9  Unknown

Clearly, the partition table contains junk. So, e2fsck cannot
find your file system. First repair the partition table
using fdisk, then try e2fsck again.

 
 
 

Bad magic number in super-block (help!)

Post by Gunnar Solbe » Tue, 19 Sep 1995 04:00:00


I'm in trouble. Yesterday my machine started swapping like crazy, and
after about 45 min of heavy swapping i managed to log in, and saw that
a cern-httpd were using all the memory (I have no idea why). I managed
to kill it, and everything looked ok. Just to make sure everything got
cleaned up properly I did a 'shutdown -r now' and when i booted fsck
told me that the superblock on one of my partitions was corrupt. I
tried using the alternative superblocks, but to no avail. Fdisk reports
totaly false information about the partition, but i guess it gets it info
from the superblock. (The partition is ext2 by the way)

To the point: Are there any way to "reconstruct" the superblock? I
know the size of the partition, where it starts and where it ends. I
made a "copy" of the partition with dd, but i guess that wont help
much either. I thought i maybe could remove the partition and write
it back with the "copy" of it, but i guess dd also copied the super-
block, so it wouldn't be any good.

Are there any solutions (except deleting partition and restoring from
latest backup)?

Am I the only one this has happened to?

Some info about the system:

Pentium 100Mhz running Linux v1.2.12
40Mb RAM, ~130Mb swap
Buslogic scsi-controller
The disk is a quantum, model empire_2100s

This is what fsck reports: (e2fsck -b 8193 /dev/sda8 reports the same)
-----
Parallelizing fsck version 0.5b (14-Feb-95)
e2fsck 0.5b, 14-Feb-95 for EXT2 FS 0.5a, 94/10/23
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda8

The filesystem superblock is corrupt.  Try running e2fsck with an alternate
superblock using the -b option.  (8193 is commonly an alternate superblock;
Hence, 'e2fsck -b 8193 <device>' may recover the filesystem.)
-----

This is what fdisk says:

-----
Command (m for help): p

Disk /dev/sda: 64 heads, 32 sectors, 2006 cylinders
Units = cylinders of 2048 * 512 bytes

   Device Boot  Begin   Start     End  Blocks   Id  System
/dev/sda1   *       1       1      81   82928   83  Linux native
/dev/sda2          82      82     582  513024   83  Linux native
/dev/sda3         583     583     783  205824   82  Linux swap
/dev/sda4         784     784    2006 1252352    5  Extended
Partition 4 has different physical/logical endings:
     phys=(1023, 63, 32) logical=(2005, 63, 32)
/dev/sda5         786     786    1086  308224   83  Linux native
/dev/sda6        1087    1087    1487  410624   83  Linux native
/dev/sda7        1488    1488    1888  410624   83  Linux native
/dev/sda8   ?  198406  198665  857117674254724   a9  Unknown
-----

Thanks for any help,
Gunnar Solberg


 
 
 

Bad magic number in super-block (help!)

Post by Horst von Bra » Thu, 28 Sep 1995 04:00:00




>I'm in trouble. Yesterday my machine started swapping like crazy, [...]
>[Corrupt partition table]

Something similar happened to me with an IDE disk; after a couple days of
little use after reinstalling everything the disk was dead for good.
Luckily the machine was new, and I got a new disk as warranty.  The data
was lost :(

To be more precise: It looked like the controller wrote blocks of zeroes
only, perhaps at random, to the disk.

Good luck!
--

Departamento de Informatica                     Fono: +56 32 626364 x 431
Universidad Tecnica Federico Santa Maria        Fax:  +56 32 625217
Casilla 110-V, Valparaiso, Chile

 
 
 

1. Bad magic number in super-block / Group descriptors look bad

Hi,

Ever found yourself in this situation ?
You've had a power-failure or just did something very bad with your
harddisk
and now when trying to mount it fsck screams:

Group descriptors look bad... trung backup blocks....
/sbin/e2fsck: Bad magic number in super-block while trying to open
/dev/hdb1

I've had this problem 2 times before now, and i've had a hell of a
time finding any docs related. I DID eventually find this:
(Note: text below is copy-pasted together from several articles, and
so not
 written by myself...)

----- begin of article pastes ----------------

From MANPAGES of mke2fs:

-S
Write superblock and group descriptors only. This is useful if all of
the superblock and backup superblocks are corrupted,
 and a last-ditch recovery method is desired. It causes mke2fs to
reinitialize the superblock and group descriptors, while not
 touching the inode table and the block and inode bitmaps. The e2fsck
program should be run immediately after this option is used,
 and there is no guarantee that any data will be salvageable.

Ofcourse you're should only try this when you've exhausted all other
options.
Other options are:

fsck -b 32 /dev/hdb1  (use the first backup super-block)

To determine the locations of the backup superblocks:
# newfs -N /dev/r

    Caution: Use the "N" option. If the "n" option is used, the
filesystem
             may be destroyed.

Example using fsck on a backup superblock:

     /dev/rsd1a:   204540 sectors in 974 cylinders of 6 tracks, 35
sectors
     104.7MB in 61 cyl groups (16 c/g, 1.72MB/g, 768 i/g)
     super-block backups (for fsck -b #) at:
     32, 3440, 6848, 10256, 13664, 17072, 20480, 23888, 26912,
     30320, 33728, 37136, 40544, 43952, 47360, 50768, 53792, 57200,
     60608, 64016, 67424, 70832, 74240, 77648, 80672, 84080, 87488,
     90896, 94304, 97712, 101120, 104528, 107552, 110960, 114368,
117776,
     121184, 124592, 128000, 131408, 134432, 137840,141248, 144656,
148064,
     151472, 154880, 158288, 161312, 164720, 168128, 171536, 174944,
178352,
     181760, 185168, 188192, 191600, 195008, 198416, 201824,

         In this example, 201824 is the last backup superblock
location
         198416 is the next to last backup superblock location.

------------- end of article pastes --------------
Also it's interesting to note that it seems the larger the disk
the less backup super-block are stored.. I my case, on a 40 GB Maxtor:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
2654208, 4096000

where the only backups, (the newfs command mentioned above, was not
installed here, and i could not find it anywhere) i learned this only
after mk2fs told me after it had written the new super-block to my
disk...

Hope this helpes some people !

Best regards,

Jan Wilmans

2. Printing man pages

3. HELP!! - bad magic number in super-block.

4. xmus v2001.12.02

5. Error when booting; bad magic number in super-block; please help!

6. HELP - can't IP FOWARD

7. Newbie: Bad magic number in super-block

8. CDRecord

9. bad magic number in super-block

10. e2fsck: bad magic number in super-block

11. Bad magic number in super-block

12. Bad magic number in super-block ?

13. bad magic number in super-block