Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I messed up my bin/sh file, overwriting it with a database file in Virtualmin. After I restarted, Ubuntu Server won't start properly anymore. The error I face is:

init:Failed to spawn plymouth main process:Unable to execute: No such file or directory.

I have a live CD here but I don't really know how to use it to overwrite the corrupted bin/sh.

Could someone help me resolve the situation.

share|improve this question

Thanks a lot sergey! :) Managed to work it out. Seems like I have already mounted it yesterday by blindly following a similar situation on a certain forum. Just wasn't sure on what to place after "/dev". Again, thanks a lot for your help. :D

To those who might encounter the same issue (and a complete newbie like me), here are the steps to take:

  1. Use a live cd/disk to boot in to the messed up OS/Computer. (Use unetbootin for live disk). Choose Try Ubuntu without Installing.

  2. Open a terminal. Check the name of the partition(with the messed up sh) to be mounted by typing sudo fdisk -l. Note: l is a letter.

  3. Mount the partition to any of the live cd's folder. For example sudo mount /dev/sda /media. Where sda is the name of the partition.

  4. Then navigate to /media using cd.

cd /bin
sudo rm sh
sudo ln -s bash sh
sudo apt-get update
sudo apt-get install --reinstall dash

These worked for me. :D

Again, thank Sergey.

share|improve this answer

On my machine /bin/sh is a symlink to dash. All you need is to restore the symlink.

While booted from the LiveCD, mount the root partition somewhere (say, /media/disk), then

cd /media/disk/bin
sudo rm ./sh
sudo ln -s dash ./sh

Something like that.

Update: Regarding "mount the root partition somewhere" - if you booted from a LiveCD and have a full GUI, the easiest would be to open the file browser, in the left pane there will be a few entries one of which correspond to the partition on the hard drive where your Ubuntu is installed (a.k.a "root" partition). Just clicking on the entry mounts the partition and displays its contents. You can tell it's a root partition if you see bin, boot, dev, etc, ..., var directories there.

When you click on the entry in the file browser's left pane, what's happening behind the scenes is the filesystem is getting mounted as a subtree inside some directory, usually /media. You can check that using the file browser too.

After you figured out where your partition is mounted at, you open terminal and re-create a symlink.

share|improve this answer
Thanks for the fast reply Sergey. :) But i'm really new at this. I'm now on the same computer with the messed up bin/sh. Booted using a live disk (try ubuntu without installing option). I'm having trouble with the statement "mount the root partition somewhere (say, /media/disk).". What is a root partition? Sorry for really a total noob at this. I'm just using the ubuntu server as a web server. Please be patient with me. :) – krose626 Sep 14 '12 at 3:22
@krose626: I updated the answer – Sergey Sep 14 '12 at 3:58
@Sergey: (Posting this on behalf of new user @SaminOz): I have the same issue. I overwrote ./sh and received the same error message + a few additional similar ones (failed to spawn hwclock etc.) - I've been through these steps with the symlink etc. but errors are still there. Is there anything else I can try? or do I go for the reinstall? – Aditya Jan 10 '13 at 10:10
@SaminOz: what is ./sh? It means "sh in the current directory" - it is possible that you created a file called sh somewhere, without overriding /bin/sh and it takes precendence over /bin/sh?. Also note that in the original question the system failed to boot at very early stages - does yours boot? – Sergey Jan 10 '13 at 20:19

Your Answer


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.