# ext2 - 200gb partition suddenly stops working

## lonepie

Okay, so I've been doing a lot of maitenance to my gentoo box lately: updating the kernel, emerging updates, reworking my firewall, etc, etc...

Tonight I noticed that my 200gb ext2 filesystem stopped working! I spent a good amount of time looking at these forums along with google, trying to find a fix. 

Here is the output from mount:

```
mount /dev/hdb1 /mnt/hdb1

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

       missing codepage or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so
```

Okay, I checked dmesg | tail and found:

```
EXT2-fs: hdb1: couldn't mount RDWR because of unsupported optional features (b980).
```

I tried a e2fsck to no avail, it complained: "e2fsck: Bad magic number in super-block while trying to open /dev/hdb1".

Also, I tried using various backup superblocks yielded from mke2fs -n /dev/hdb1, still no luck.. I'm afraid to try more at this point because I can't afford to lose the data on the drive.

Curiously, I was able to boot up on both the ubuntu livecd AND gentoo livecd and mount the filesystem without problem. So, I decided to take the entry for the drive out of my /etc/fstab... still nothing...

I could go out and buy a new HDD tomorrow and copy all of the contents of hdb1 to it using a livecd, but I don't really want to pay money for a new drive, ya know? I could also try backing it up to various network drives on my LAN, but that seems like it'll be a pain as well... 

SO! Any ideas on what to do? Should I try more backup superblocks with e2fsck -b? Or should I try to write new superblocks with mke2fs -S? I'm a bit boggled on this one... Also, the system is the primary firewall/router for my entire house, so people come yell at me when this thing's down!

Kernel is: 2.6.16-gentoo-r9

----------

## NeddySeagoon

lonepie,

The first thing is to not do anything rash with your only copy of the data. So it you want to try something drastic, like writing a new superblock, do a backup first.

You say you have made a new kernel. Try booting your old kernel. Can you mount the partition then ?

```
unsupported optional features
```

can mean your need  *Quote:*   

> Ext2 extended attributes 

 in your kernel, and its now missing.

Is the filesystem really ext2 ?

200Gb is huge for a non journalled filesystem. can you mount it with the -t ext3 option to mount ?

----------

## lonepie

Thanks for the reply... I checked my kernel config and ext2 and ext3 extended attributes are available, along with several other options. I then rebuilt the kernel just to be sure, but that didn't seem to have any effect. I tried booting off of my old kernel and I still couldn't get the drive to mount. And yes, I'm sure it's ext2.. it has been working as such for over 2 years.

----------

## lonepie

I don't understand why I can mount the drive without problem if I boot up on a LiveCD... can anybody explain to me why I am able to mount on a livecd but not on my gentoo install?

----------

## NeddySeagoon

lonepie,

Maybe the kernel you are running did not come from the config you are checking ?

What does 

```
uname -a 
```

show ?

Look at the date/time, its the running kernel build date and time. Does it look right ?

How does it compare to the date/time on the file /usr/src/liniux/arch/<your_arch>/boot/bzImage ?

If the latter is more recent, you hane made an error installing your kernel.

----------

## lonepie

Here's the output from uname -a:

```
... 2.6.16-gentoo-r9 #3 SMP PREEMPT Sat Jun 10 12:31:50 EST 2006 i686 ...
```

The plot thickens... I bought a replacement drive today... booted off my livecd to format/partition it with reiserfs filesystem. I start copying a few of the more important files from the old drive to the new one. Now, when I boot back into gentoo, I get a very similar error message when trying to mount the new drive...

I'm rebuilding my kernel right now with the extended attributes for reiserfs, among other things that I may have overlooked before...I'll post when I get the results...

Thank you for offering your support!

----------

## lonepie

jeeze... still won't let me mount EITHER drive using the new kernel... I'm really confused now as to what's wrong

Here's the output when I try to mount the new drive:

```
mount -t reiserfs /dev/hdd1 /mnt/hdd1

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

       missing codepage or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so

```

Dmesg | tail says...

```
ReiserFS: hdd1: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on hdd1

```

The drive is brand new..  I just formatted it using the gparted live cd... what's going on here??!

----------

## troymc

Does your new kernel have a proper codepage built?

Specifically, Is the codepage you have set as default built?

Or maybe more pertinently, is the codepage you formatted these drives with available in your new kernel?

```

File systems  --->

     Native Language Support  --->

        <*> Base native language support

        (iso8859-1) Default NLS Option

        <M>   Codepage 437 (United States, Canada)

        <*>   NLS ISO 8859-1  (Latin 1; Western European Languages)

        <M>   ASCII (United States)

        <*>   NLS UTF8

```

These 4 will handle +95% of stuff (at least for U.S. users).

ASCII is for really old DOS & obscure stuff.

CP437 is for old Windows stuff (FAT, Win3.x & Win9x stuff)

UTF8 is unicode & for NTFS & modern stuff

ISO8859-1 is for modern non-unicode stuff (use -15 if you want the euro stuff)

troymc

----------

## lonepie

Thanks for the suggestion... here is my current kernel config for NLS:

```
# Native Language Support

#

CONFIG_NLS=y

CONFIG_NLS_DEFAULT="iso8859-1"

CONFIG_NLS_CODEPAGE_437=y

# CONFIG_NLS_ASCII is not set

CONFIG_NLS_ISO8859_1=y

CONFIG_NLS_UTF8=y
```

Only thing missing is ASCII, which I'll go ahead and enable..

----------

## lonepie

well, I never managed to get either drive working in gentoo again... I don't know why it happened, but I can bet it had something to do with me doing an etc-update rather loosley...

Anyway.. I've migrated to ubuntu server and my drives work! It's a pity though, Gentoo was lots of fun to play with... I used it for almost 3 years on my server. I still have the full gentoo install on my harddrive, so maybe I will still attempt to fix it...

----------

