# Bad magic number in superblock, again!

## the.root

Alright, so I installed gentoo on a new htpc I built, and everything seemed to be working good for a week. Rebooted several times, then one time I did, I got the error, bad superblock on my /tmp part sda8. I couldn't find anyway around it, and I wanted to resize my partitions anyways so I decided to wipe out the partition table and all partitions then redo it all (with fdisk from the minimal cd).

Finally got everything built again, had rebooted twice, everything seemed fine. I do it a third time, and now it's saying every logical partition on my extended partiton's superblock is bad. (My primary/ first three boot and work fine)

```
localhost grub # mount /dev/sda6 -t ext3 /home

mount: wrong fs type, bad option, bad superblock on /dev/sda6,

       missing codepage or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so

```

(same error for sda6-9 (sda5 is swap, which swapon will not mount))

```
localhost grub # dmesg | tail

sd 6:0:0:3: [sdg] Attached SCSI removable disk

sd 6:0:0:3: Attached scsi generic sg7 type 0

usb-storage: device scan complete

Unable to find swap-space signature

Unable to find swap-space signature

VFS: Can't find ext3 filesystem on dev sda6.

EXT2-fs warning (device sda1): ext2_fill_super: mounting ext3 filesystem as ext2

FAT: bogus number of reserved sectors

VFS: Can't find a valid FAT filesystem on dev sda6.

VFS: Can't find ext3 filesystem on dev sda6.

```

```

localhost grub # fsck.ext3 /dev/sda6

e2fsck 1.39 (29-May-2006)

Couldn't find ext2 superblock, trying backup blocks...

fsck.ext3: Bad magic number in super-block while trying to open /dev/sda6

The superblock could not be read or does not describe a correct ext2

filesystem.  If the device is valid and it really contains an ext2

filesystem (and not swap or ufs or something else), then the superblock

is corrupt, and you might try running e2fsck with an alternate superblock:

    e2fsck -b 8193 <device>

```

(same for sda6-9)

I tried running with the -b 8193, but produced the exact same error. Not sure if that's where my alternative superblocks are stored or not. Figured my blocksize was 4096 I tried -b 32768 with the exact same output as above.

```

localhost grub # fdisk -l /dev/sda

Disk /dev/sda: 150.0 GB, 150039945216 bytes

255 heads, 63 sectors/track, 18241 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1           7       56196   83  Linux

/dev/sda2               8        1664    13309852+  83  Linux

/dev/sda3            1665        2441     6241252+  83  Linux

/dev/sda4            2442       18241   126913500    5  Extended

/dev/sda5            2442        2564      987966   83  Linux

/dev/sda6            2565        3781     9775521   83  Linux

/dev/sda7            3782        4998     9775521   83  Linux

/dev/sda8            4999        5607     4891761   83  Linux

/dev/sda9            5608       18241   101482573+  83  Linux

```

Oh and I tried all of this on a knoppix live cd as well, with the same results.

I'm not really sure where to go from here, any advice would be greatly appreciated! Is this indicating a Hard Drive with bad blocks? or a software issue? Thanks!

Alright so I checked for bad blocks using badblocks -n on all the partitions. It didn't find any. The only things I did in between the last two reboots was, emerge -uD --newuse world, revdep-rebuild, (had to remerge emul-linux-x86-xlibs) and dispatch-conf.

This is on an amd64, 2.6.22-gentoo-r8, the hdd is a raptor 150, m2n32sli motherboard.

UPDATE-

I deleted then repartitioned the extended and everything after again, with an openSuSe CD. So far, no errors, fsck, everything seems good. We'll see if it happens again. I kinda am leaning towards something that happened in the world update or a file change by dispatch-conf(there were 28, so I couldn't name everyone I had to go through)

----------

## NeddySeagoon

the.root,

Are you booting sometimes with a usb-storage device attached ?

That can change the way the BIOS numbers drives.

----------

## the.root

Thanks for the reply!

I've always had a usb-storage device attached. I really haven't taken the card out yet.

I don't really think that's the problem because fdisk still showed all my partitions as the correct sda#. And like I said I know it was in there when I built it to right now. And the first three partitions on the drive worked and booted fine.

----------

## bobber205

I had a new install that just randomly had a bad superbloak error when first installing.

Need to install gurb but can't because /dev/hda1 is screwed up.

Weird eh?

----------

## the.root

Yeah it is weird. If I have some time this weekend, I'll try to reproduce it again and narrow it down.

If you mkfs on the /boot partition and chroot into that from the CD, then emerge grub. You should be able to no problem. It rebuilds the FS and superblock when you mkfs.(that is if /boot is it's own partition hda1, otherwise you might have to start over or find another work around)

----------

## bobber205

Found my problem.

Recreating the filesystem solved my problem. Must have been a fluke. Sucks major though. Thank god it's only the boot partition!

----------

