drscheme
Posts: 20
Joined: Thu Feb 14, 2013 8:33 am

cannot execute binary file

Thu Feb 14, 2013 8:42 am

Hi,

I repeatedly run into some strange problem with my new Pi. After rebooting the machine I get the following error message when I run commands in the shell, e.g.:

[email protected] ~ $ clear
-bash: /usr/bin/clear: cannot execute binary file

[email protected] ~ $ sudo reboot
[sudo] password for xx:
sudo: unable to open /var/lib/sudo/hk/0: Read-only file system
/sbin/reboot: 1: /sbin/reboot: Syntax error: word unexpected (expecting ")")

The odd thing is that some commands seem to work...

[email protected] ~ $ uname -a
Linux raspberrypi 3.6.11+ #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013 armv6l GNU/Linux

[email protected] ~ $ ls -l
total 44
-rw-r--r-- 1 xx xx 466 Feb 14 00:08 interfaces
...

... also the webserver I installed is still accessible.

I wasn't able to fix the problem. Do you have any advice? What is the cause for this effect? I'm asking as I experienced this already yesterday and reinstalled the machine which I do not want to do on a daily basis, ... ;-)

Best regards!

drscheme
Posts: 20
Joined: Thu Feb 14, 2013 8:33 am

Re: cannot execute binary file

Thu Feb 14, 2013 8:51 am

Update:

As the "reboot" command did not work anymore I had to reboot the Pi by pulling the power plug. Now it doesn't boot anymore. The last lines on the boot screen are:

PANIC: VFS: Unable to mount root fs on unknown-block

Entering kdb (current= ...) due to Keyboard Entry
kdb> _

Any suggestions?

User avatar
joan
Posts: 14845
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: cannot execute binary file

Thu Feb 14, 2013 9:11 am

It sounds like you need to reflash the image. :(

drscheme
Posts: 20
Joined: Thu Feb 14, 2013 8:33 am

Re: cannot execute binary file

Thu Feb 14, 2013 10:54 am

Yes, I had to. But where does this come from?

User avatar
joan
Posts: 14845
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: cannot execute binary file

Thu Feb 14, 2013 11:00 am

drscheme wrote:Yes, I had to. But where does this come from?
Anyone's guess. Bad SD card, cosmic ray strike?

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: cannot execute binary file

Thu Feb 14, 2013 12:01 pm

Overclocking can cause sd card corruption.
Improper shutting down the system (without sudo poweroff or sudo halt first) can also corrupt the sd card rootfs partition.
Some sd cards appear to be more sensitive to it than others.

drscheme
Posts: 20
Joined: Thu Feb 14, 2013 8:33 am

Re: cannot execute binary file

Thu Feb 14, 2013 12:17 pm

I "only" run the device at 800MHz. Now I totally switched off overclocking.

But meanwhile I assume it's the power supply. Most probably the power plug is not sufficient to additionally power a WLAN USB Stick directly plugged into the RPi...

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: cannot execute binary file

Thu Feb 14, 2013 1:09 pm

The polyfuse can also trip if you consume much current on the usb ports.
It's 1.1 or 1.2 amps.
It might be worth measuring your TP1 - TP2 voltage with and without the stick.
You need at least 4.85V for a stable operation. (Some will say less)

oldschl
Posts: 7
Joined: Mon Feb 25, 2013 11:03 pm

Re: cannot execute binary file

Tue Feb 26, 2013 2:04 pm

This may be the second time this has happened to me. The RPi ran all night, no problem. I did an upgrade last night, so that may have had something to do with it.

I check in on my progress with sickbeard and it says it doesn't have any permissions to write to the database. I had this happen with a previous card and I couldn't save it and had to recreate the image. I was able to SSH into the RPi, but now I'm getting -Bash: ./reboot: cannot execute binary file. I'm afraid to reboot the machine because I don't want to recreate the image (I have another problem with backing up images that I'm going to post in a minute).

Anyone have an idea what's going on? I do not have anything hooked into the USB ports, and I would be surprised if a power problem would cause an OS corruption like this. This has happened to me twice now.

oldschl
Posts: 7
Joined: Mon Feb 25, 2013 11:03 pm

Re: cannot execute binary file

Tue Feb 26, 2013 2:29 pm

More info:

Code: Select all

[email protected] /sbin $ sudo fsck
fsck from util-linux 2.20.1
e2fsck 1.42.5 (29-Jul-2012)
/dev/mmcblk0p2: recovering journal
fsck.ext4: Bad magic number in super-block while trying to re-open /dev/mmcblk0p2
Signal (11) SIGSEGV si_code=SEGV_MAPERR fault addr=0x60

Code: Select all

[email protected] /sbin $ sudo fsck /dev/root
fsck from util-linux 2.20.1
e2fsck 1.42.5 (29-Jul-2012)
ext2fs_open2: Bad magic number in super-block
fsck.ext4: Superblock invalid, trying backup blocks...
/dev/mmcblk0p2: recovering journal
fsck.ext4: unable to set superblock flags on /dev/mmcblk0p2


/dev/mmcblk0p2: ***** FILE SYSTEM WAS MODIFIED *****

/dev/mmcblk0p2: ********** WARNING: Filesystem still has errors **********

mattbornski
Posts: 2
Joined: Mon May 13, 2013 6:52 pm

Re: cannot execute binary file

Mon May 13, 2013 6:58 pm

Hi there,

I've been having this issue recently as well. I had a Pi which was running pretty much flawlessly, but then I exhausted the SD card space. I realized that I hadn't expanded the partition to fill the card - a simple procedure via raspi_config - but I took the opportunity to rebuild the Pi using a newer distribution.

Upon rebuilding my Pi, I started having very similar issues being unable to execute very normal utilities.

Code: Select all

$ du -sh
-bash: /usr/bin/du: cannot execute binary file
I reflashed the card, rebuilt the system once more, and it re-occurred. I'll attempt to determine if:
1. my card went bad
2. there's something wrong with the new distribution [2013-02-09-wheezy-raspbian]
3. expanding the filesystem to fill the card causes the corruption

mattbornski
Posts: 2
Joined: Mon May 13, 2013 6:52 pm

Re: cannot execute binary file

Thu May 16, 2013 9:09 pm

So far, simply by using a new SD card with the same distribution and expanding the root filesystem in the same way, the problem has not recurred. It appears that the card which came with my Adafruit RaspPi starter kit doesn't play well with the Pi, but a Kingston card I purchased separately seems to be behaving better.

User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Re: cannot execute binary file

Wed Oct 22, 2014 5:13 am

Last night I had the same exact problem as in the OP. Really disappointing. What can be done to prevent this? My b+ RPI has been running flawlessly for about a week, continually, and now this. Power supply was one from RS rated 1250mA, WiFi dongle connected but not in use. I've always power-cycled cleanly with "sudo halt". A Kingston 16 GB class 4 micro sdcard was in use mounted. Maybe better class 6 or even 10?
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac

drgeoff
Posts: 10521
Joined: Wed Jan 25, 2012 6:39 pm

Re: cannot execute binary file

Wed Oct 22, 2014 10:10 am

dentex wrote:A Kingston 16 GB class 4 micro sdcard was in use mounted. Maybe better class 6 or even 10?
Class of SD card is very unlikely to be a factor in risk of corruption.

On the other hand, some people say that higher class cards are not the best choice from a performance point of view with the RPi because they are optimised for a different scenario (eg cameras writing quite large files) than in a RPi.

User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Re: cannot execute binary file

Wed Oct 22, 2014 5:26 pm

drgeoff wrote:Class of SD card is very unlikely to be a factor in risk of corruption.
Ok, then what is?
On the other hand, some people say that higher class cards are not the best choice from a performance point of view with the RPi because they are optimised for a different scenario (eg cameras writing quite large files) than in a RPi.
Fair enough, I've never thought about this.

Anyway, is such a PITA now. I have the same sdcard ready with a new Raspbian install. I'm wondering if it will work. I'll try it tomorrow.
I also have daily backups of my /home/pi folder where I have all the script for the project i was running; plus all the /etc folder for system configuration.

Do anyone know how much are this failures likely? I mean, I thought I could have left a RPI running for months.
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac

rushed4nr
Posts: 1
Joined: Sun Jan 18, 2015 9:34 pm

Re: cannot execute binary file

Sun Jan 18, 2015 9:42 pm

Curious to know if the binaries that won't execute are only those commands in the /usr/bin/ directory?
Commands in /bin/ will run without issue.
That's what I'm experiencing on a hummingboard.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12836
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: cannot execute binary file

Sun Jan 18, 2015 10:47 pm

On linux all files have a "flag" that control if any file is an executable. also the extension has no special meaning in linux, so an .exe isn't specifically an executable (not that executable files in linux normally have a .exe file extension either).

If you have super user rights you can change the file attributes.

User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Re: cannot execute binary file

Mon Jan 19, 2015 7:25 am

I've been able to "circumvent" this issue running the root filesystem from an external USB pen drive. There's a good explanation here on the forum: somewhere. Sorry I'm not putting the link now, I'm on the go http://www.raspberrypi.org/forums/viewt ... =29&t=6125

This way, I've been running my RPI for months. Only things that remains on the sdcard are the boot information.
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac

Return to “Troubleshooting”