Solved

inittab not found Centos

Posted on 2014-04-28
13
741 Views
Last Modified: 2014-06-04
Hi Experts

I am having the error on centos while booting i.e. "inittab not found" . The server was up and running and suddenly blank screen came but i was able to ping the server but couldnt logged into to it so i shut it down and restart but after restarting i got the above error.

So i try some different steps like

1- try to get into the different run levels but every time i got the error no more " "processes left in this runlevel " .
2- try to boot from knoppix live cd.  i used "fdisk -l " and "df -h" commands to check the actual mounted and logical drives, and was able to see them. the solution is to find inintab file into /etc directory or create a new one with required parameters But i coudlnt find /etc directory the whole folder was missing. I tried "fsck " on the drives too but of no avail.

Actually asterisk was installed on that server and all the config files were stored in /etc directory and ofcourse all the other system files too (like fstab , inintab etc ).

any help in this regard would be highly appreciated.

Thanks
0
Comment
Question by:nocinfospan
  • 5
  • 5
  • 3
13 Comments
 
LVL 1

Expert Comment

by:Mike Patton
ID: 40028687
Hi there,

It would seem as though you have suffered some catastrophic failure?  How was you system set up, in terms of volumes?  Was /etc located on the root volume?  Or elsewhere?

Were you logged in and performing any operations at the time of the initial problem?  Were you logged in as root?  Is it possible you did something like erase /etc?

If your entire /etc folder is missing, you are going to have problems.  Do you have backups?  If so, it is time to restore from your most recent backup.  If not...  You might be in for a re-install from scratch (and this time, set up some backups).

Regards,

M.
0
 
LVL 1

Author Comment

by:nocinfospan
ID: 40028767
How was you system set up, in terms of volumes?  
there are two drives /dev/sda1 & /dev/sda2
Was /etc located on the root volume?
its on a root volume

Were you logged in and performing any operations at the time of the initial problem?

no

 Were you logged in as root?  Is it possible you did something like erase /etc?

no
0
 
LVL 1

Expert Comment

by:Mike Patton
ID: 40028811
Okay.  Doesn't sound good...

I was going to request a copy of your fstab, but of course that it usually located under /etc...

Can you post the results of a: df -a

And

cat /proc/mounts

Both as root, please.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40028844
You can restore inittab from centos or scientificlinux live CD
0
 
LVL 1

Expert Comment

by:Mike Patton
ID: 40028845
I'm not sure inittab itself is the problem, as the question reported that the entire /etc structure is missing.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40028856
Which means that disk is !@#$%^^
Boot from cd, try fsck while searching for recent backup
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 1

Author Comment

by:nocinfospan
ID: 40030526
@Mike Patton

root@Microknoppix:/home/knoppix# df -a

Dateisystem      1K-Blöcke   Benutzt Verfügbar Verw% Eingehängt auf

rootfs                   0         0         0     - /

proc                     0         0         0     - /proc

sysfs                    0         0         0     - /sys

/dev/sr0           4011486   4011486         0  100% /mnt-system

tmpfs              1650688      1944   1648744    1% /ramdisk

/dev/cloop         9742394   9742394         0  100% /KNOPPIX

unionfs            1650688      1944   1648744    1% /UNIONFS

unionfs            1650688      1944   1648744    1% /usr

unionfs            1650688      1944   1648744    1% /home

tmpfs                10240        60     10180    1% /UNIONFS/var/run

tmpfs                20480      2740     17740   14% /run

tmpfs                10240         0     10240    0% /UNIONFS/var/lock

tmpfs               102400        68    102332    1% /UNIONFS/var/log

tmpfs              2097152         8   2097144    1% /tmp

udev                 20480         4     20476    1% /dev

tmpfs              2097152         0   2097152    0% /dev/shm

devpts                   0         0         0     - /dev/pts

gvfs-fuse-daemon         0         0         0     - /home/knoppix/.gvfs

/dev/sda1        302382384 176082312 110939928   62% /media/sda1

/dev/sda3        211219668    161104 200329156    1% /media/sda3


root@Microknoppix:/home/knoppix# cat /proc/mounts

rootfs / rootfs rw,relatime 0 0

proc /proc proc rw,relatime 0 0

sysfs /sys sysfs rw,relatime 0 0

/dev/sr0 /mnt-system iso9660 ro,relatime 0 0

tmpfs /ramdisk tmpfs rw,relatime,size=1650688k 0 0

/dev/cloop /KNOPPIX iso9660 ro,relatime 0 0

unionfs /UNIONFS aufs rw,relatime,si=51df28d8,noplink 0 0

unionfs /usr aufs rw,relatime,si=51df28d8,noplink 0 0

unionfs /home aufs rw,relatime,si=51df28d8,noplink 0 0

tmpfs /UNIONFS/var/run tmpfs rw,relatime,size=10240k 0 0

tmpfs /run tmpfs rw,relatime,size=20480k 0 0

tmpfs /UNIONFS/var/lock tmpfs rw,relatime,size=10240k 0 0

tmpfs /UNIONFS/var/log tmpfs rw,relatime,size=102400k 0 0

tmpfs /tmp tmpfs rw,relatime,size=2097152k 0 0

udev /dev tmpfs rw,relatime,size=20480k 0 0

tmpfs /dev/shm tmpfs rw,relatime,size=2097152k 0 0

devpts /dev/pts devpts rw,relatime,mode=1777 0 0

gvfs-fuse-daemon /home/knoppix/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0

/dev/sda1 /media/sda1 ext3 rw,nosuid,nodev,relatime,errors=continue,barrier=1,data=writeback 0 0

/dev/sda3 /media/sda3 ext3 rw,nosuid,nodev,relatime,errors=continue,barrier=1,data=writeback 0 0
0
 
LVL 1

Expert Comment

by:Mike Patton
ID: 40030613
Okay thanks for that. One last request (I hope).

Can you please give me a dump of:

fdisk -l /dev/sda
0
 
LVL 61

Expert Comment

by:gheist
ID: 40030679
Please do
#export LANG=C LC_ALL=C
before running any commands or get English version of knoppix.
0
 
LVL 1

Author Comment

by:nocinfospan
ID: 40030811
FYI :The mount changed to sdb from sda.

root@Microknoppix:# fdisk -l /dev/sdb

Disk /dev/sdb: 584.7 GB, 584652423168 bytes
255 heads, 63 sectors/track, 71079 cylinders, total 1141899264 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000dfeab

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63   614405924   307202931   83  Linux
/dev/sdb2       614405925   712707659    49150867+  82  Linux swap / Solaris
/dev/sdb3       712707660  1141884134   214588237+  83  Linux
0
 
LVL 61

Expert Comment

by:gheist
ID: 40030823
run fsck against the Linux type filesystems...
mount them and see if the biggest one has /etc/inittab...
0
 
LVL 1

Accepted Solution

by:
Mike Patton earned 500 total points
ID: 40030836
I believe the author has already tried fsck (original post), however I guess it's worth a shot. Unfortunately if you are unable to find /etc on either of these volumes, you are without luck.

You may be better off saving all your data to a removable drive (or network drive) and reinstalling you're OS. Then bring your data back as you recreate your services etc.

And again, please make backups next time.

Sorry I couldn't be more help.

M.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40030864
While in knoppix - check
smartctl -a /dev/sdb
If you get any other system health estimate than:
SMART overall-health self-assessment test result: PASSED
Disk is dead. You may or may not be able to copy data to new disk.

To restore inittab that is missing:
If you manage to boot centos 5 dvd you get into recovery mode (subject to /etc/fstab on same filesystem) with network...
After chroot do:
yum reinstall initscripts
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now