LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 09:33 AM   #1
itsallgood
LQ Newbie
 
Registered: Jan 2015
Posts: 26

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, 10:12 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
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, 10:13 AM   #3
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

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

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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, 11:25 AM   #5
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
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, 11:26 AM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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, 12:27 PM   #7
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
Code:
# ln -s /sbin/init /lib/systemd/systemd
Perhaps?
 
Old 03-15-2015, 12:37 PM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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



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 03: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 06:56 AM
boot failure- sbin/init missing? help whatpot Ubuntu 3 10-27-2009 11:39 PM
/sbin/init errors on boot dereko Debian 2 03-17-2005 10:56 AM
/sbin/init problems with initrd-boot Fonk Linux - Software 1 03-06-2005 12:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:01 AM.

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