Having some issues with a mail server running CentOS, don't really know what had been done do it so I'm a bit stumped, when booting the server I get the following error:
Code:
EXT3-fs: unable to read superblock
mount: error mounting /dev/root on /sysroot as ext3: Invalid argument
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - Not syncing: Attempted to kill init!
I can boot the machine from a liveCD and mount the 2 drives(Mirrored in raid 0) and get the data from them but I would like to resolve the booting issue)
Did quite a lot of googling around yesterday but didn't resolve the issue. My linux knowledge is quite limited to desktop use but from what I can understand it seems like the partition table or some of the config files(like fstab or initrd) are a bit messed up,
Booting from the LiveCD and mounting the drives I get this info
sudo fdisk -l
Code:
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000d6faf
Device Boot Start End Blocks Id System
/dev/sda1 * 384 9729 75071745 fd Linux raid autodetect
Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00098835
Device Boot Start End Blocks Id System
/dev/sdb1 384 9729 75071745 fd Linux raid autodetect
/dev/sdb2 * 1 383 3076416 82 Linux swap / Solaris
Partition table entries are not in disk order
ubuntu@ubuntu:~$
/etc/fstab and grub config:
Code:
GNU nano 2.0.9 File: /mnt/etc/fstab
/dev/md0 / ext3 defaults,usrquota,grpquota 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
/boot/grub/grub.conf contains the following,
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/md0
# initrd /boot/initrd-version.img
#boot=/dev/md0
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-53.1.13.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-53.1.13.el5 ro root=/dev/md0
initrd /boot/initrd-2.6.18-53.1.13.el5.img
title CentOS (2.6.18-53.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-53.el5 ro root=/dev/md0
initrd /boot/initrd-2.6.18-53.el5.img
Please let me know if you need more information to help me resolve this issue, thank you.
-edit-
An update, did some tinkering around from the LiveCD
sudo fsck /dev/sda1
fsck: fsck.linux_raid_member: not found
fsck: Error 2 while executing fsck.linux_raid_member for /dev/sda1
sudo fsck /dev/sda
fsck.ext2: superblock invalid, trying backup block
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda
e2fsck -b 8193 /dev/sda(This was a succestion made by fsck to try)
e2fsck: Bad magic number in super-block while trying to open /dev/sda
Is there a way to find out what superblocks to try and would that resolve the issue?
When trying to sudo fdisk /dev/sda1 I get:
Device contains neither a valid DOS partiton table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk ID blahblah
Changes will remain in memory onle, until you decide to write them.
After that, of course, the previous content won't be recoverable.
The number of cylinders for this disk is set to 9346
There is nothing wrong with that, but this is larger than 1024
Warning: Invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Something occured to me, the number of cylinders for the disk is set to 9346 but the /dev/sda1 and sdb1 start at the 384 cylinder and end with 9729, can't this cause the problem and if it is how do i change the set cylinder numbers for the disk - does it involve re-creating the partition table or is there a shorter way?
At boot the mdadm starts the mirror image with the drives sda1 and sdb1 and names it md127, but the grub.conf and fstab set it as md0, changing it doesn't change anything as it seems.. my mdadm.conf is:
Code:
DEVICE partitions
MAILADDR root
ARRAY /dev/md0 super-minor=0