fsck.ext4 Bad magic number in super-block while trying to open /dev/sde2 - Solved

After attempting to upgrade from Suse 12.2 to 12.3 I was immediately greeted by the following error when booting.

Trying manual resume from /dev/disk/by-id/ata-WDC_WD1200BB-22RDA0_WD-WCANN1299072-part2
Trying manual resume from /dev/disk/by-id/ata-WDC_WD1200BB-22RDA0_WD-WCANN1299072-part2
Waiting for device /dev/sde2 to appear: ok
fsck from util-linux 2.21.2
[/sbin/fsck.ext4 (1) – /] fsck.ext4 Bad magic number in super-block while trying to open /dev/sde2
/dev/sde2:
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>

fsck failed. Mounting root device read-only.
Mounting root /dev/sde2

mount -o ro,acl,user_xatter -t ext4 /dev/sde2 /root

2.884564] EXT4-fs (sde2): VFS: Can't find ext4 filesystem
mount: wrong fs type, bad option, bad superblock on /dev/sde2,        
       missing codepage or helper program, or other error
              In some cases useful info is found in syslog - try
   dmesg | tail  or so

could not mount root filesystem – exiting to /bin/sh
sh: cannot set terminal process group (-1): Inappropriate ioctl for device
sh: no job control i this shell
$_

ImageShack® - Online Photo and Video Hosting

This turned out to be a grub problem and had nothing to do with the filesystem. The BIOS was initially reporting the disk order differently than the OS was expecting, so what it was really doing was fsck’ing the swap partition rather than the root partition.

To correct this problem I changed the value for root in the file /boot/grub/menu.lst

from:

kernel /vmlinuz-3.7.10-1.4-desktop root=/dev/sde2 video=1920x1080 resume=/dev/disk/by-id/ata-WDC_WD1200BB-22RDA0_WD-WCANN1299072-part2 splash=silent quiet showopts

to:

kernel /vmlinuz-3.7.10-1.4-desktop root=/dev/disk/by-id/ata-WDC_WD5000AAKB-00YSA0_WD-WCAS84802505-part2 video=1920x1080 resume=/dev/disk/by-id/ata-WDC_WD1200BB-22RDA0_WD-WCANN1299072-part2 splash=silent quiet showopts

then everything worked fine.

This is why the advice to never use device names, but to always use ID, label or UUID.

I have one box where the hard drive is always “/dev/sda” when running opensuse. But I also had Fedora installed for a while. And, with Fedora, the hard drive is “/dev/sdb” if there happens to be a USB drive plugged in at the time of boot.

And openSUSE uses the by-id method since way before 12.2. Thus I do not understand why that wasn’t the case in your GRUB.Unless you use a GRUB not initiated by an openSUSE installation of course.

The old 12.2 installation was an out-of-the-box DVD Suse installation, however prior to 12.2 the machine had 11.1 on it which was too old to upgrade to 12.2, so I had to perform a new install at the time so the /boot partition was reformatted.