How to boot RHEL with no bash?

Posted by nmelmun on Super User See other posts from Super User or by nmelmun
Published on 2012-10-19T00:34:31Z Indexed on 2012/10/26 5:06 UTC
Read the original article Hit count: 309

Filed under:
|
|

How can I boot a RHEL VM if I deleted /bin/bash? When trying to boot, I now get the following error:

"INIT: Cannot execute "/etc/rc/d/rc.sysinit"

The next thing I tried was to modify the kernel boot parameters by adding init=/bin/ksh at the end of the line, which gave me a functional shell. After this, in order to get write permissions, I remounted the root partition with:

mount -o remount,rw /

Then I tried to boot using ksh as the shell by tricking the system into thinking it's bash:

ln -s /bin/ksh /bin/bash

Then restarted the system normally. Unfortunately this didnt work since ksh is not compatible and /etc/rc.d/rc.sysinit uses several bash-specific tricks.

Does anyone else have a suggestion on how I could get the system to boot normally without reinstalling bash?

© Super User or respective owner

Related posts about bash

Related posts about boot