I've created a minimal environment on my embedded ARM device consisting of just the Linux kernel, and with Busybox and a minimal filesystem in an initrd image. I have an inittab that runs /etc/init.d/rcS on start up.

I have the following line in rcS:

/bin/mount -t proc none /proc

However, when this line runs, I get

/etc/init.d/rcS: line 2: /bin/mount -t proc none /proc: not found

The last line of rcS appears to execute - that line is simply /bin/sh to get a shell, and the shell opens automatically.

When I run the exact same mount command from the shell, it works. /bin/mount is a symlink to /bin/busybox.

Why isn't my script able to find /bin/mount?

  • Could you please post an exact copy-and-paste of the contents of rcS (or upload to gist.github.com if it is too big)? Also, are you sure you have the error message copied exactly right? – BenjiWiebe Jul 11 '14 at 20:38
  • I found my error, see my answer below. Thanks, though :) – Steve Jul 11 '14 at 21:12

As it turns out, the spaces in the file were actually two characters, 0xD0 0xA0 (Unicode? Maybe it's just a coincidence that those look like CR/LF left shifted 4 bits... They also appear as a single blank character, not two). A clue right off the bat was the error message - it should have only displayed the command, not the parameters, but there wasn't any whitespace in the line.

Once I discovered that, I realized what the cause probably was. My OS is Windows 7, and I'm running Ubuntu in a VirtualBox VM, and I use a shared clipboard. I had copied the script from a webpage in Chrome on Windows 7 and pasted it into gedit on Ubuntu. Either those characters were copied from the web page, or something didn't play right with encoding on the way from the page to gedit.

Replacing those with space characters solved it.

| improve this answer | |
  • Interesting problem. And fix. :) – BenjiWiebe Jul 11 '14 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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