LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Deleted /sbin/init ... recovered from live CD, still will not boot? (https://www.linuxquestions.org/questions/linux-newbie-8/deleted-sbin-init-recovered-from-live-cd-still-will-not-boot-4175536638/)

itsallgood 03-13-2015 09:33 AM

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.

linosaurusroot 03-13-2015 10:12 AM

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) ?

linosaurusroot 03-13-2015 10:13 AM

Did you restore the /sbin/init to the right directory - as the machine will see it when booting from disk?

jpollard 03-15-2015 08:29 AM

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_u:object_r:init_exec_t:s0

linosaurusroot 03-15-2015 11:25 AM

From my Fedora box
$ ls -lZ /sbin/init
lrwxrwxrwx. root root system_u : object_r : bin_t : s0 /sbin/init -> ../lib/systemd/systemd

rknichols 03-15-2015 11:26 AM

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.

Head_on_a_Stick 03-15-2015 12:27 PM

Code:

# ln -s /sbin/init /lib/systemd/systemd
Perhaps?

rknichols 03-15-2015 12:37 PM

Quote:

Originally Posted by Head_on_a_Stick (Post 5332533)
Code:

# ln -s /sbin/init /lib/systemd/systemd
Perhaps?

CentOS 6.6 does not use systemd.


All times are GMT -5. The time now is 11:50 AM.