Centos 5.4 fails on boot with INIT

Say, Boot stops with INIT: No inittab file found. Enter run level.....

Say how can I fix drive to boot...?
shaunwinginAsked:
Who is Participating?
 
wesly_chenCommented:
If the system boot normally before, then it sounds like filesystem corruption.

1. boot into single user mode
From Grub boot menu, press "e" key twice, and append "1" at the following line
-----------
    kernel /vmlinuz-xxxx.el5 ro root=/dev/xxxx  1
----------
Then press "Enter" key and "b" key

2. Run fsck
# fsck /dev/sda  ( you have IDE hard disk, fsck /dev/hda)
or in Grub menu, the line you see above
  kernel .... root=/dev/VolGroup00/LogVol00
where root=/dev/<something>
do
# fsck /dev/<something>

Then reboot.
0
 
arnoldCommented:
set initlevel s or 1 for single user and the make sure there is an inittab or that /etc exists and it is not a drive issue that prevents the mounting of / /etc etc.

The contents of inittab should be
#
# inittab       This file describes how the INIT process should set up
#               the system in a certain run-level.
#
# Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#               Modified for RHS Linux by Marc Ewing and Donnie Barnes
#

# Default runlevel. The runlevels used by RHS are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
#
id:3:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# When our UPS tells us power has failed, assume we have a few minutes
# of power left.  Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly.
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

# If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"


# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6

# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon

Open in new window

0
 
eagerCommented:
You might want to boot from a Linux rescue disk.  Most distro disks have a rescue mode.  
Fsck will not make modifications to a mounted file system, so when booting in single user mode it will tell you if there are errors, but not fix them.  
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
shaunwinginAuthor Commented:
Whats the link for the Centos 5.4 Rescue disk please?
0
 
eagerCommented:
http://www.centos.org.  Pick any download; they will all serve as a rescue disk.
0
 
wesly_chenCommented:
In single user mode, you can umount the filesystem or mount as read-only
(# mount -o ro / )
Then run fsck, it will fix the filesystem error.

I will try the single user mode first beofre I go for rescue CD since it is easier.
0
 
eagerCommented:
@wesley_chen:  When you boot in single user mode, / is mounted r/w.  You cannot unmount it; umount will fail, telling you that the device is busy.  Same error when you try to change it to r/o.

Running fsck on a mounted file system, even r/o, is a bad idea.  Fsck warns you.  Pay attention to the warning.  
0
 
arnoldCommented:
R/o means no fixes of any kind can be done if needed. An error with mounting a file system is often because the partition is in a "bad" state and fsck often can fix by correcting orphaned inodes/references to non-existant files, etc.

At times if the partition (/) is messed up enough, going into single mode is not an option since /bin/fsck can not be accessed and the use of an external boot (rescue CD or install CD) is needed to get to a point where you have a shell on the system with the drives. You would need to know how the system/partitions were setup.  But even if you do not everything can be determined, i.e. check which drives are present, then check how they are partitioned, and go from there one step at a time. i.e. raw partitions are easier to deal than LVM since you would need to use LVM to map them and then see further on how they are subdivided.
0
 
wesly_chenCommented:
> You cannot unmount it;
I can do
mount -o remount,ro  /
without problem in single user mode.

Anyway, I agree boot from rescue CD is better.
0
 
arnoldCommented:
Wesly, what is the point in remounting the root partition in ro mode on a system that does not boot because inittab can not be found/loaded/exists??
The fix is either because there is a corruption of the file system or the inittab file is missing. fsck to repair the file system vi to recreate the inittab.  remounting the partition (/) in read-only will prevent/eliminate both options until the partition is remounted to read/write.
0
 
shaunwinginAuthor Commented:
I've booted with rescue CD
It took me to sh-3.2# prmomt.
I ran chroot /mnt/sysimage - no issues.
then fsck /dev/sdb (as sata)
Errors:
fsck.ext2 Device buys while trying to open /dev/sdb
File system opened exclusively.

By the way
cd /
ls
returns what looks like normal directory structure...
Help....
0
 
wesly_chenCommented:
Please umount it first.
Use mount command to see the mount points and umount them all.
i.e.
umount -f  /dev/sdb

Then run fsck
0
 
wesly_chenCommented:
By the way don't run chroot after boot from rescue CD. Otherwise you can not umount it.
0
 
shaunwinginAuthor Commented:
The rescue takes me to the prmpt and sais system mounted under the /mnt/sysimage automatically!
mount displays a long list e.g.
/proc on /proc type proc (rw)
...
/dev on /mnt/sysimage/dev/pts etc.
umount -f /dev/sdb retuns: forced umount failed

any ideas...?

0
 
eagerCommented:
Reboot rescue disk.  Do not run chroot.

Does your execution of "mount" show anything mounted on /mnt/sysimage?
Run
  #  mount | grep sysimage

You should be able to unmount it as follows:

  #  cd /
  #  umount /mnt/sysimage

You should not need the -f option.

Display the partition table:

  #  fdisk -l /dev/sdb   (assuming that /dev/sdbx was mounted on /mnt/sysimage)

This should list each of the partitions except the swap partition.  Test each:

  #  fsck /dev/sdb1  
  #  fsck /dev/sdb2

If fsck does not show any errors, your problem is not caused by a disk crash.
0
 
eagerCommented:
Er, test each partition, except the swap partition.
0
 
shaunwinginAuthor Commented:
mount | grep sysimage
returns
/dev/mapper/pdc....
/....
/dev on /mnt/sysimage/dev/pts
/selinux on " "/selinux

#  cd /
#  umount /mnt/sysimage
Error:Inappropriate ioctl for device

0
 
wesly_chenCommented:
> /dev/mapper/pdc....
Please post complete line of "mount" output.

Your system use LVM. So it is very important to get the filesystem path.
0
 
shaunwinginAuthor Commented:
/dev/mapper/pdc_db....bip2 on /mnt/sysimage type ext3 (rw,data=ordered)
/dev/mapper/pdc_db....bip1 on /mnt/sysimage/boot type ext3 (rw,data=ordered)
0
 
shaunwinginAuthor Commented:
Please note its a RAID system - there are 2 raids in mirrored mode. No errors on raid reported.
0
 
shaunwinginAuthor Commented:
RAID 1 that is
0
 
arnoldCommented:
Look at /boot/grub.conf and see which drive is supposed to be the boot drive.
You are telling what you are running, but we have no idea what your setup is, if your system is LVM partitioned, you can not run fsck.* on the raw partitions since they most often will be LVM types and fsck can only check filesystems ext2, ext3, ext4, etc.

please post the complete output of fdisk -l including the type of the filesystem

0
 
shaunwinginAuthor Commented:
fdisk -l
shows identical entries for sda and sdb
DEVICE       BOOT    SYSTEM
/dev/sda1      *         Linux
/dev/sda2                 Linux
/dev/sda3                 Linux Swap/Solaris

 /boot/grub.conf  doesn'tt exist but seems from above that sda1 is boot.
0
 
arnoldCommented:
Could you please post the complete data that is returned for fdisk -l for both drives?
run
mount /dev/sda1 /mnt
then ld -l /mnt
is this the /boot partition.

/dev/sda1 can be the boot (/boot) the problem is if /dev/sdb* is defined as / and that is where the issue is.
0
 
shaunwinginAuthor Commented:
Its a RAID 1 setup and sdb is identical to sda
DEVICE       BOOT    SYSTEM
/dev/sdb1      *         Linux
/dev/sdb2                 Linux
/dev/sdb3                 Linux Swap/Solaris
0
 
arnoldCommented:
Please post the entire set of data, including the size,
The information you include provides part of a picture.

The problem is that the information you post does not make it clear how you setup the OS in the first place.
0
 
shaunwinginAuthor Commented:
I can't get access to the machine to copy and paste
If I ssh into it connection is refused. I'm in the rescue bootup.
0
 
arnoldCommented:
I understand that, can you mount /dev/sda1 /dev/sdb1 and see what is in them?
How did you partition and allocate the partitions?
can you do the same for /dev/sda2 and /dev/sdb2 and see what is in them.
mount

Can you post the blocks for each partition?
i.e. /dev/sda1 /dev/sdb1 ~100MB
/dev/sda2 /dev/sdb2 ~60GB

Did this system ever boot? Or is it your first attempt at setting it up?
0
 
eagerCommented:
@shaunwingin -- It is very difficult to tell what is going on with your system, especially when the info comes out in little bits and you don't give us the entire output from diagnostic commands.

Tell us about the system:  how many disks, how configured, RAID configuration, LVM configuration, and anything else you can tell us.  Please don't decide what we need to know.

How did you install the system?  What options?  
Is this a new install?  Was it running and then crashed?  

We have been assuming that there was a failure and your system did not reboot.  But, as Arnold points out, you don't say that this was the case.  

If this is a new install, the best solution is to start over.
0
 
wesly_chenCommented:
Hi shaunwingin, here is typical fdisk -l output with LVM
----------------
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       19452   156143767+  8e  Linux LVM
-----------
We would like to know the info for 1st (Device), 6th(Id) and 7th (System) columns.

And the line in /boot/grub/menu.lst (after you chroot)
--------
    kernel /vmlinuz-xxxx.el5 ro root=/dev/xxxx  
--------
what is /dev/xxx after root=


If you have software RAID1, then try to boot from one hard disk first to see whether you can boot from one of them.
0
 
shaunwinginAuthor Commented:
I'm trying to ssh into the system.
Its a clean install off a TirxBox  CD which uses CENTOS 5.4
There are 2 hard disks using software RAID 1.
I get the same error if I boot off 1 disk.
How can I ssh into it so I can copy and paste...

This is fdisk -l
  Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       30175 242276275 83  Linux
/dev/sda3              30176   30272 779152 82 Linux swap/Solaris

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       30175 242276275 83  Linux
/dev/sda3              30176   30272 779152 82 Linux swap/Solaris
0
 
shaunwinginAuthor Commented:
Correction
This is fdisk -l
  Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       30175 242276275 83  Linux
/dev/sda3              30176   30272 779152 82 Linux swap/Solaris

  Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          13      104391   83  Linux
/dev/sdb2              14       30175 242276275 83  Linux
/dev/sdb3              30176   30272 779152 82 Linux swap/Solaris
0
 
shaunwinginAuthor Commented:

And the line in /boot/grub/menu.lst (after you chroot):

kernel /xen.gz-2.6.18-164.11.1.el5
module /vmlinuz-2.6.18-164.11.1.el5xen ro root=LABEL=/
module /initrd-2.6.18-164.11.1.el5xen.img
0
 
wesly_chenCommented:
No PV (Id 8e), so no LVM involved.
So /dev/mapper should be software RAID.
Please boot from rescue CD with one disk and
# cd /
# mount
# umount -f /<mount-point of hard disk>
# fsck /dev/sda1
# fsck /dev/sda2
0
 
eagerCommented:
Assuming that you downloaded an ISO image for Trixbox, did you run md5sum on the image?  Did it match the md5 for the image as listed on the Trixbox website?  

0
 
shaunwinginAuthor Commented:
There was no issue with Trixbox install...
 What is  <mount-point of hard disk>   in I umount -f /<mount-point of hard disk>
0
 
wesly_chenCommented:
what is the output of
# mount | grep sda
0
 
eagerCommented:
Did you check the ISO image?  

"There was no issue with Trixbox install" -- Did this system ever boot?  
0
 
arnoldCommented:
The problem seems to me is that mdadm fails to assemble the software raid and it is the one referenced in the boot directive for label ROOT.
mdadm -a -e /dev/sd[ab]2

Did you then overlay the Software RAID with an LVM volume??

Which directions did you follow to set this system up?
0
 
shaunwinginAuthor Commented:
I followed default install on TrixBox CD.
0
 
shaunwinginAuthor Commented:
Ive reinstalled trixbox as per the original drive configuration.
I've got one of the original drives with the initab issue.
Do you think its worth doing a copy of sdb2 of the old drive overwriteing the identical new drive.
I'm trying to save re-installing and configuring the system.
How can I do the copy of sdb2 as above?
0
 
eagerCommented:
How are you configuring the disks when you install?

It is very odd that one drive in a RAID would work and a second drive would fail.  

Check the disks:  Download and burn a CD of either Hitachi or Seagate's drive test programs.  Boot the CD and run test on each of the drives.  
0
 
shaunwinginAuthor Commented:
I"ll restate my question:

Ive reinstalled trixbox as per the original drive configuration used above on 2 Disks in RAID 1 mode.
I've STILL got a 3rd drive (one of the original drives with the initab issue detailed above) with all the date on it.
This drive was a pair onto which the Trixbox was installed exactly as I've now done it.
I'm trying to save re-installing and configuring the system.

Do you think its worth overwriting the sdb2 of the new drive with the sdb2 of the old drive

How can I do the copy of sdb2 as above while booted into the new trixbox install?
The old drive's data appears as sdc2.
0
 
eagerCommented:
You need to actually answer questions:  How did you configure the disks?  

It is impossible to answer your question about copying drives without knowing how you configured the RAID.
I don't know what the "old sdb2" or the "new sdb2" contain.  

You mention TWO disks in a RAID configuration.  Now there are THREE.

How did you configure the disks?  
0
 
arnoldCommented:
You can attach the drive and use it as a reference to configure the newly functional install. Why introduce uncertainty? It is easier to setup/troubleshoot an item that is not working while it is the only one being modified, versus trying to figure out which of the many components is causing trouble.  You could backup the default configuration and then copy the one from the prior drive. Test to make sure all is functional and proceed to the next one.
0
 
shaunwinginAuthor Commented:
Essentially had to re-install...
0
 
shaunwinginAuthor Commented:
I've found whats causing the inittab missing issue...
I inserted a usb stick with latest Ubuntu version and booted into Ubuntu to view drives....
After browsing drives and removing USB stick and rebooting on Centos 5.4 install, I get the inittab error...!
Ubuntu is doing something to drives by the looks of things...?
0
 
arnoldCommented:
When you were using the USB stick/Ubuntu, were you modifying anything? Just booting a computer using a different method should not alter the system. What were you doing to the drives while booted using the USB stick?
0
 
shaunwinginAuthor Commented:
Just viewed the contents of the drives! no copying or changes done!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.