Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a machine running Ubuntu Server 11.10. There are two internal SATA drives and I had previously had them both mounted and accessible. The machine has recently been moved and after starting it up again the secondary drive isn't mounted. My initial attempt to mount it:

sudo mount /dev/sdb /mnt/norm

resulted in the following error message:

mount: you must specify the filesystem type

So I used:

sudo parted -l

determine the file system type and it gave me the following output:

Model: ATA Hitachi HDS72101 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  996GB   996GB   primary   ext4            boot
 2      996GB   1000GB  4024MB  extended
 5      996GB   1000GB  4024MB  logical   linux-swap(v1)


Model: ATA WDC WD10EADS-00L (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      17.4kB  1000GB  1000GB  ext4

so I added this to the mount command:

sudo mount -t ext4 /dev/sdb /mnt/norm

and this resulted in the following error:

    mount: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error. In some cases useful info is found in syslog - try dmesg | tail or so

dmesg | tail shows the following message:

EXT4-fs (sdb): VFS: Can't find ext4 filesystem

Can anyone suggest a next step for me here?

share|improve this question
    
In some cases useful info is found in syslog - try dmesg | tail. Maybe you should try that. :-) Anything of interest in there? –  Bart De Vos May 16 '12 at 10:49
    
@Bart: Sorry, meant to add that and forgot. I've edited the question to include it now. –  hellsgate May 16 '12 at 10:54
    
Are you sure that drive contained an ext4 filesystem, and not, say, ext3? vfat? ntfs (shudder)? xfs etc.? –  growse May 16 '12 at 11:02
add comment

2 Answers

I figured it out and its a pebkac issue. The command I should have been running was:

sudo mount /dev/sdb1 /mnt/norm

(Note the '1' after sdb). I sometimes think I should take up a career where I'm nowhere near a computer :)

share|improve this answer
    
hah, I never even noticed that - I'm sure I have done similar before, perhaps someone else will benefit from my superblock answer :) Even so, it does beg the question - why was this not mounted automatically? Did you forget to (or incorrectly) add an entry for /dev/sdb1 to /etc/fstab? Your question implied it had been mounted before so I had assumed that the mount at boot time had failed. –  Adam C May 16 '12 at 14:42
1  
@Adam: When I originally mounted the drive it was the first time I had ever performed that operation, so I missed the step of adding it to /etc/fstab through inexperience and the machine had never been rebooted after that. It has now been added to fstab and tested successfully. –  hellsgate May 18 '12 at 10:32
add comment

As you can see, the first thing we need to rule out is a bad super block, so let's start a filesystem check:

sudo fsck.ext4 -v /dev/sdb

If it is a bad superblock you will get messaging similar to:

Bad magic number in super-block while trying to open /dev/sdbX
The superblock could not be read or does not describe a correct ext4 filesystem
If the device is valid and it really contains an ext4 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>

So, find the superblock backups:

sudo mke2fs -n /dev/sdb

At the bottom of the output you will see a list of the backup superblocks. You can restore it with:

sudo e2fsck -b block_number /dev/sdb

Where block_number is one of the listed backups. If the first is unsuccessful, try a couple of the others.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.