LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-03-2009, 04:53 AM   #1
RickyJaff
Member
 
Registered: Oct 2003
Distribution: RedHaT, ELX, DragonLinux, Knoppix.
Posts: 89

Rep: Reputation: 15
Server Unable to Boot bcz of /etc/inittab error


Hi,

I have old CentOS 4.6 server and its unable to boot now, I have access to it in Single user mode over KVM and I desperately need help to get it running so that I can take necessary backup, after that I will do OS upgrade and other upgrade such cent os 5.2 etc..

Error I am getting is :
Code:
INIT: /etc/inittab["line_number"] : missing action field
INIT: /etc/inittab["line_number"] : missing action field
INIT: /etc/inittab["line_number"] : missing action field
"NIT: Cannot Execut /etc/rc.d/rc.sysinit
I looked forum and I found that might be bcz I edited /etc/inittab from windows machine as difference of line handling in windows and linux causes problem.

Prior to this problem, I had upgraded PERL using "CPAN" on my server and added MONIT, for Monit I had added following lines in /etc/inittab as per docs. And it is the only Modification I did to inittab.
Code:
#For MONIT
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc
I later removed it using vi over console but still same error.

Also I had this error lately :
Code:
INIT: "X" respawning too fast 
INIT: "X" respawning too fast 
INIT: "X" respawning too fast
but server was running and I had plan to troubleshoot it once I upgrade my perl etc.

but now I am unable to boot.
Below is my /etc/inittab
Code:
#
# 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

#For MONIT
#mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc

# 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
Now I am connect to server over KVM in single user mode, please help me what I am supposed to do now ..

Thankyou!
 
Old 04-03-2009, 05:31 AM   #2
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
If the problem is indeed because of bad Windows line endings, you can quickly convert it to Unix format:

[root@server] dos2unix /etc/inittab

If you get a "command not found" then you need to first install the dos2unix utility:

[root@server] yum install dos2unix
 
Old 04-03-2009, 05:43 AM   #3
RickyJaff
Member
 
Registered: Oct 2003
Distribution: RedHaT, ELX, DragonLinux, Knoppix.
Posts: 89

Original Poster
Rep: Reputation: 15
Thanx for your insight

I had edited it using "vi" and then saved it, isn't it supposed to be in now saved in linux friendly format as saved via linux ?
 
Old 04-03-2009, 05:53 AM   #4
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
No, vi will preserve the DOS/Windows line endings. There maybe a way of forcing vi to save with Unix line endings, I'm not sure. dos2unix is quick and easy
 
Old 04-03-2009, 06:20 AM   #5
RickyJaff
Member
 
Registered: Oct 2003
Distribution: RedHaT, ELX, DragonLinux, Knoppix.
Posts: 89

Original Poster
Rep: Reputation: 15
Unfortunately what I got is single user mode and I can't install dos2unix and most of the things are not available ! no dos2unix available !
 
Old 04-03-2009, 06:31 AM   #6
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
I quick google turned up the vi answer.

Open the file in vi and:

Code:
:set fileformat=unix 
:wq
The conversion can also be done using awk... google "awk convert dos to unix" or something similar.
 
Old 04-03-2009, 06:42 AM   #7
RickyJaff
Member
 
Registered: Oct 2003
Distribution: RedHaT, ELX, DragonLinux, Knoppix.
Posts: 89

Original Poster
Rep: Reputation: 15
ya, I was also doing googling and before doing anything, I decided to create a backup of inittab but when I did :
cp /etc/inittab /etc/inittab.bak

I get error
Code:
cannot create regular file : etc/inittab " Read only filesystem
??
Does that means that in single user mode, its readonly mode ?
 
Old 04-03-2009, 06:57 AM   #8
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
Quote:
Originally Posted by RickyJaff View Post
Does that means that in single user mode, its readonly mode ?
I didn't think so. See what the 'mount' command tells you, should see (rw) after each mount. Also see what 'dmesg' reports, that's the boot log, look for any signs of errors. Is it possible that you actually have a harddrive problem?

Are you sure your booting into 'single' mode and not 'emergency' mode? I think everything is mounted read-only in emergency mode.
 
Old 04-03-2009, 07:12 AM   #9
RickyJaff
Member
 
Registered: Oct 2003
Distribution: RedHaT, ELX, DragonLinux, Knoppix.
Posts: 89

Original Poster
Rep: Reputation: 15
Here is the screenshot.. its seems RW
http://img7.imageshack.us/img7/137/consolemount.jpg

But why its not working, I want to have a backup before doing anything, moreover if its readonly then can't do anything either !

PS: I tried updating using VI and got error that "Unable to open file for writing"

hmm .. just solved the problem by :
Code:
mount -o remount -w /

Last edited by RickyJaff; 04-03-2009 at 07:26 AM.
 
Old 04-03-2009, 07:38 AM   #10
RickyJaff
Member
 
Registered: Oct 2003
Distribution: RedHaT, ELX, DragonLinux, Knoppix.
Posts: 89

Original Poster
Rep: Reputation: 15
Kudos..

Vi Trick did the job

thnx Buddy. I really appreciate your time

I give you Thank
 
Old 04-03-2009, 05:47 PM   #11
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
Glad to hear you got it fixed
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to autostart graphical login - default init set to 5 in /etc/inittab jrella SUSE / openSUSE 4 06-25-2008 07:27 AM
Unable to find inittab file after reboot subramaniana Linux - General 2 11-28-2006 04:25 AM
filesystem error unable to boot, how to restore the boot nesargha Linux - Hardware 6 06-14-2006 02:29 AM
Unable to chmod on inittab CrackerJack Linux - Security 2 08-20-2004 10:23 PM
Error: Unable to boot from CD Retsyn Linux - Newbie 11 08-17-2002 07:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration