Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Your best bet will be to boot from your CDROM, then :

  • mount / /mount/point (rw)
  • cp /bin/bash /mount/point/bin/bash
share|improve this answer

RHEL uses bash as its default shell. Your best bet is to copy it back in. You can use a DVD or other media to boot linux rescue and copy /bin/bash into /mnt/sysimage/bin/

If this is a VM, you have a couple other options:

  1. Do you have a snapshot from before you deleted the shell? If so, can you back up to the snapshot?
  2. Do you have data or files on it you can't afford to lose? If this is a relatively new installation, or a test install, your fastest fix may be to blow it away and recreate it.

Good luck!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.