You are not logged in.

#1 2012-11-03 06:55:35

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

/sbin/hdparm cannot execute binary file after a reboot

I haven't seen anything like this before.  Running x86_64 btw.

1) Binary works on a fresh install.
2) Same binary does NOT work after a reboot.

Fresh install
Normal functionality of /sbin/hdparm

% md5sum /sbin/hdparm  
321ff7b32611a82c719ec7f7a7b5a67c   /sbin/hdparm
% ls -l /sbin/hdparm
-rwxr-xr-x 1 root root 105440 Sep 30 15:25 /sbin/hdparm

Upon rebooting
...note the DIFFERENT md5sum and the different DTS!

Trying to run from zsh:

% hdparm
zsh: exec format error: hdparm

/sbin/hdparm: /sbin/hdparm: cannot execute binary file

Or under bash:

$ hdparm
bash: /sbin/hdparm: cannot execute binary file

The permissions are fine:

% ls -l /sbin/hdparm
-rwxr-xr-x 1 root root 105440 Nov  3 02:47 /sbin/hdparm

If I capture its md5sum:

% md5sum /sbin/hdparm
13a9aae49a2da531f9612a558accc371  /sbin/hdparm

Last edited by graysky (2012-11-03 14:34:53)

Offline

#2 2012-11-03 09:05:18

samuvuo
Member
From: Finland
Registered: 2011-02-20
Posts: 84

Re: /sbin/hdparm cannot execute binary file after a reboot

graysky wrote:

Now, I reinstall and everything is fine; note the DIFFERENT md5sum:

Am I missing something? The md5sums look indentical to me.

Offline

#3 2012-11-03 11:47:31

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: /sbin/hdparm cannot execute binary file after a reboot

samuvuo wrote:

Am I missing something? The md5sums look indentical to me.

Copy/paste error hmm  Corrected now.  But the problem still haunts me.  I can find no evidence of HDD corruption.

Offline

#4 2012-11-03 14:12:45

samuvuo
Member
From: Finland
Registered: 2011-02-20
Posts: 84

Re: /sbin/hdparm cannot execute binary file after a reboot

Weird, indeed. The only times I've seen "cannot execute binary file" has been when "shebang" (#!) was missing in a bash script.

What's the file size of the current, re-installed hdparm? What does ls -l show?

/sbin/hdparm in my system matches the your first listing, ie. hdparm that gave you the error:

$ ls -l /sbin/hdparm 
-rwxr-xr-x 1 root root 105440 2012-09-30 22:25 /sbin/hdparm

$ md5sum /sbin/hdparm 
321ff7b32611a82c719ec7f7a7b5a67c  /sbin/hdparm

(hdparm 9.42-1)

Last edited by samuvuo (2012-11-03 14:12:59)

Offline

#5 2012-11-03 14:35:43

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: /sbin/hdparm cannot execute binary file after a reboot

@samuvuo - I edited the original post answering your questions.  I also made it more clear.

Offline

#6 2012-11-03 14:49:13

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: /sbin/hdparm cannot execute binary file after a reboot

Run /sbin/hdparm, not hdparm.

If that doesn't work, the output of 'file' or 'ldd' on the binary might be nice.

Offline

#7 2012-11-03 14:58:06

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: /sbin/hdparm cannot execute binary file after a reboot

falconindy wrote:

Run /sbin/hdparm, not hdparm.

If that doesn't work, the output of 'file' or 'ldd' on the binary might be nice.

I think he already fixed it by reinstalling the pacage.  But is now wondering why/how this happened.  Am I correct graysky?

Offline

#8 2012-11-03 15:09:25

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: /sbin/hdparm cannot execute binary file after a reboot

falconindy wrote:

Run /sbin/hdparm, not hdparm.
If that doesn't work, the output of 'file' or 'ldd' on the binary might be nice.

Calling either `hdparm` or `/sbin/hdparm` gives the same results.
Output of file and ldd on the functional binary:

% file /sbin/hdparm 
/sbin/hdparm: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0xa19d099d5f1b403e4b26a73ce02f12a07ecc0a6d, stripped

% ldd /sbin/hdparm 
	linux-vdso.so.1 (0x00007fffd00f9000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007ff1e1fc4000)
	/lib/ld-linux-x86-64.so.2 (0x00007ff1e236b000)

Now that I need to, I cannot reproduce the 'broken' state!

Offline

#9 2012-11-03 17:40:59

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: /sbin/hdparm cannot execute binary file after a reboot

[OT]

samuvuo wrote:

Weird, indeed. The only times I've seen "cannot execute binary file" has been when "shebang" (#!) was missing in a bash script.

Hmm.. can you post an example script. Since bash scripts aren't binaries, I am confused how bash can say that.

[/OT]

Offline

#10 2012-11-06 14:46:47

Shark
Member
From: /dev/zero
Registered: 2011-02-28
Posts: 686

Re: /sbin/hdparm cannot execute binary file after a reboot

My problem is not the same as yours but yesterday i have migrated to zsh (it's just awesome smile
Now, i have a script which is executed when i unplug the adapter from laptop (via udev rule) and in the script there is a hdparm command without prefix /sbin. Till i migrated to zsh that worked just fine but when i replaced #!/bin/bash for #!/bin/zsh in the script only hdparm command didn't work. So i had to put a full path (/sbin/hdparm) in the script in order to be fully workable. Really weird.

When i type hdparm in zsh it behaves it should and it is not giving me any errors but haven't yet tested md5sum discrepancies. Maybe because i have i686??

EDIT: Actually i have problem with many paths - even when using iwconfig. Hm...

Last edited by Shark (2012-11-06 14:54:20)


If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau

Registered Linux User: #559057

Offline

Board footer

Powered by FluxBB