# error when mounting a disk

## Net-Base.dk

Hey...

I get this error when i try 2 mount one of my drives.

command line:

# mount /dev/hdf1 /disks/hdf

error:

Mount: wrong fs type, bad option, bad superblock on /dev/hdf1, or too many mounted file system.

In my system i have my Gentoo installed on /dev/hda and then i have 4 extra disk in.

/dev/hdc = 30Gb

/dev/hdd = 30Gb

/dev/hde = 40Gb

/dev/hdf = 40Gb

My system was running fine and some day it crash and no i can't moung /dev/hdf1?

Can someone tell my why?

----------

## NeddySeagoon

Net-Base.dk,

If it was working, crashed, now its not, the filesystem on /dev/hdf1 may be damaged.

Do not run fsck on it just yet. It can make things worse ather than better.

First tell us the filesystem type, then we can advise on how to survey the damage (if any) without making it worse.

You may want to make a backup of /dev/hdf1 with dd if you don't have a current backup.

Read man dd

----------

## Net-Base.dk

Im not shure but i think it is ext3, but how can i see it?

----------

## NeddySeagoon

Net-Base.dk,

Look in /etc/fstab.  You should have recorded it there if you wanted it to auto mount at startup or allow users to mount it.

If it is ext3 (or ext2) the same tools apply. If its another filesystem, do *not* do the following. 

```
man e2fsck
```

 will tell you whats happening understand it before you run the commands below.

Run 

```
e2fsck -n /dev/hdf1
```

It will report the first error and exit.

If you have a corrupt superblock try 

```
e2fsck -b 32768 -n /dev/hdf1
```

This uses an alternate superblock to check the rest of the filesystem.

Post back with your results.

----------

## Net-Base.dk

Okay i have now run.

# e2fsck -n /dev/hdf1

and i get this message.

e2fsck 1.37 (21-mar-2005)

/dev/hdf1: Attempt to read block from filesystem resulted in short read while reading block 522

/dev/hdf1: Attempt to read block from filesystem resulted in short read while reding journal superblock

e2fsck:Attempt to read block from filesystem resulted in short read while checking ext3 journal for /dev/hdf1

What should i do now?

----------

## NeddySeagoon

Net-Base.dk,

Your journal is damaged so some data may be lost.

Its now time to decide if you want to attempt recovery and if you want to make a backup first.

To make a backup, do 

```
dd if=/dev/hdf1 of=/path/to/backup
```

you need as much space as /dev/hdf1 occupies.

You can backup to a network device (another PC) if you use nfs.

To do the recovery, do 

```
e2fsck -y /dev/hdf1
```

this will remove your journal and do whatever else is needed to return your filesystem to a self consistant state. You must understand that this says nothing about the data on the filesystem.

Providing this step completes successfully, you will have an ext2 filesystem on /dev/hdf1 (the journal was removed)

Mount it read only and look around  

```
mount -t ext2 -o ro /dev/hdf1 /some/mountpoint
```

If you have lots of numbered files in lost+found and not much else, you need to decide how much time you want to spend on data salvage.

Providing everything looks normal, the journal can be added back with tune2fs.

----------

## Net-Base.dk

Hey. I have now tryed to recovery my Hdd with this code

```
mount -t ext2 -o ro /dev/hdf1 /some/mountpoint
```

But i can't i just get this message

e2fsck 1.37 (21-mar-2005)

/dev/hdf1: Attempt to read block from filesystem resulted in short read while reading block 522

/dev/hdf1: Attempt to read block from filesystem resulted in short read while reding journal superblock

e2fsck:Attempt to read block from filesystem resulted in short read while checking ext3 journal for /dev/hdf1 

Then i have tryed to mount with Read-Only and then i get this message.

Mount: wrong fs type, bad option, bad superblock on /dev/hdf1, or too many mounted file system.

Is it possible save my partition, or else i just wanna delete it and then create a new.

----------

## troymc

Did you follow Neddy's suggestion about fsck'ing with an alternate superblock?

```

e2fsck -b 32768 -n /dev/hdf1

```

If so, did this complete successfully?

troymc

----------

## Net-Base.dk

Still same error.

I have another problem that we properly should solve first. After my server is crash DHCH client dont work the server dont get a IP adress when it starts, its not my DHCH there is the problem because my other computer get a IP adress... What could there be wrong???

----------

## NeddySeagoon

troymc,

Did I really say that ? The  -n hsould have been -y to change the filesystem (i.e. try to fix it) - oops.

```
e2fsck -b 32768 -y /dev/hdf1 
```

is the command to attempt do the fix.

----------

## Net-Base.dk

Same error when i try the code.

```
e2fsck -b 32768 -y /dev/hdf1
```

i get this error.

e2fsck 1.37 (21-Mar-2005)

/dev/hdf1: Attempt to read block from filesystem resulted in short read while reading block 522

/dev/hdf1: Attempt to read block from filesystem resulted in short read reading journal superblock

e2fsck: Attempt to read block from filesystem resulted in short read while checking ext3 journal for /dev/hdf1

----------

## troymc

 *NeddySeagoon wrote:*   

> troymc,
> 
> Did I really say that ? The  -n hsould have been -y to change the filesystem (i.e. try to fix it) - oops.
> 
> ```
> ...

 '

 :Laughing:  ..it's OK...I just cut-n-pasted & followed right along with you!   :Shocked: 

 *Net-Base.dk wrote:*   

> 
> 
> Same error when i try the code. 
> 
> 

 

Here are a couple of things to try. First try to remove the corrupt journal:

```

# tune2fs -f -O ^has_journal /dev/hdf1

```

If that produces the same errors that you saw before then try to remove it with debugfs:

```

# debugfs -w /dev/hdf1

debugfs: features ^has_journal

debugfs: features ^needs_recovery 

debugfs: quit

```

If either of these 2 work then immediately run that previous e2fsck -b 32768 -y /dev/hdf1 command. I would also probaby follow that with a badblocks command too.  Once you get the corruption cleared up, you can re-enable the journaling by running:

```

# tune2fs -f -O has_journal /dev/hdf1

```

If, however, you are still having problems, it's time to start thinking about rescuing as much data as you can & reformat the partition. Try using ddrescue to save a copy of the filesystem, then check the copy:

```

# ddrescue --max-retries=-1 /dev/hdf1 /somedir/rescue.file

# e2fsck -y /somedir/rescue.file

```

I hope some of this helps.

troymc

----------

## Net-Base.dk

Okay i think the problem is fixed now, i can mount the drive. 

Thx for your help.

----------

## troymc

Cool! Can you let us know what fixed it?

troymc

----------

## Net-Base.dk

Yes...

First i run this code.

```
# tune2fs -f -O ^has_journal /dev/hdf1 
```

its return with a error.

Then i run this code.

```
# debugfs -w /dev/hdf1

debugfs: features ^has_journal

debugfs: features ^needs_recovery

debugfs: quit 
```

it didn't return with a error, so i think fine lets continue with the next  code.

```
# tune2fs -f -O has_journal /dev/hdf1 
```

and it didn't came with a error to.

and then i run the first code again and this time it work, and now i can mount my drive...

----------

