LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-13-2015, 10:33 AM   #1
itsallgood
LQ Newbie
 
Registered: Jan 2015
Posts: 8

Rep: Reputation: Disabled
Question Deleted /sbin/init ... recovered from live CD, still will not boot?


Hi all,

Been messing around with my CentOS 6.6 VM trying to break stuff and learn with it. I thought it may be a good learning exercise to (ok, sounds a bit stupid, but purposely) delete /sbin/init to see how I could recover and learn.

I've booted into a recovery CD and recovered the /sbin/init file to my existing directory, however, I'm still having issues booting the machine.

Per Google suggestions, I have given the new init file 755 permissions but it still does not boot.

I apologize that I have not had more ideas, I am currently Googling solutions but am having a bit of trouble knowing where to start. Any suggestions would be greatly appreciated, thank you.
 
Old 03-13-2015, 11:12 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 979
Blog Entries: 2

Rep: Reputation: 235Reputation: 235Reputation: 235
Is this the correct /sbin/init binary for your system?
How does the boot fail?
Was there anything damaged beside removing one file?
What if you use boot parameter init=/bin/sash (assuming you have that file) ?
 
Old 03-13-2015, 11:13 AM   #3
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 979
Blog Entries: 2

Rep: Reputation: 235Reputation: 235Reputation: 235
Did you restore the /sbin/init to the right directory - as the machine will see it when booting from disk?
 
Old 03-15-2015, 09:29 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Did you set the appropriate security label on it? I think (not sure as I don't have a Centos 6 installation) it should be system_ubject_r:init_exec_t:s0
 
Old 03-15-2015, 12:25 PM   #5
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 979
Blog Entries: 2

Rep: Reputation: 235Reputation: 235Reputation: 235
From my Fedora box
$ ls -lZ /sbin/init
lrwxrwxrwx. root root system_u : object_r : bin_t : s0 /sbin/init -> ../lib/systemd/systemd
 
Old 03-15-2015, 12:26 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
How big is that "recovered" /sbin/init? The /sbin/init (41920 bytes) in the installer image is very different from the installed /sbin/init (150352 bytes). What you need to do from the recovery CD/DVD is chroot to /mnt/sysimage and run "yum reinstall upstart". That should get you a proper /sbin/init. There is only one customizable file (/etc/dbus-1/system.d/Upstart.conf) in the upstart package, so there should be no problem there.
 
Old 03-15-2015, 01:27 PM   #7
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 283Reputation: 283Reputation: 283
Code:
# ln -s /sbin/init /lib/systemd/systemd
Perhaps?
 
Old 03-15-2015, 01:37 PM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
Quote:
Originally Posted by Head_on_a_Stick View Post
Code:
# ln -s /sbin/init /lib/systemd/systemd
Perhaps?
CentOS 6.6 does not use systemd.
 
1 members found this post helpful.
  


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
Deleted /etc/psswd - Can it be recovered? dktrust Red Hat 3 08-30-2013 04:10 PM
Ubutnu won't boot. Error: Target file system doesn't have /sbin/init. No init found. Zeljka_Lin Linux - Newbie 9 05-02-2011 07:56 AM
boot failure- sbin/init missing? help whatpot Ubuntu 3 10-28-2009 12:39 AM
/sbin/init errors on boot dereko Debian 2 03-17-2005 11:56 AM
/sbin/init problems with initrd-boot Fonk Linux - Software 1 03-06-2005 01:48 PM


All times are GMT -5. The time now is 09:10 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration