You are not logged in.
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/hdparmUpon 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 fileOr under bash:
$ hdparm
bash: /sbin/hdparm: cannot execute binary fileThe permissions are fine:
% ls -l /sbin/hdparm
-rwxr-xr-x 1 root root 105440 Nov 3 02:47 /sbin/hdparmIf I capture its md5sum:
% md5sum /sbin/hdparm
13a9aae49a2da531f9612a558accc371 /sbin/hdparmLast edited by graysky (2012-11-03 14:34:53)
Offline
Now, I reinstall and everything is fine; note the DIFFERENT md5sum:
Am I missing something? The md5sums look indentical to me.
Offline
Am I missing something? The md5sums look indentical to me.
Copy/paste error
Corrected now. But the problem still haunts me. I can find no evidence of HDD corruption.
Offline
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
@samuvuo - I edited the original post answering your questions. I also made it more clear.
Offline
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
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
[OT]
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
My problem is not the same as yours but yesterday i have migrated to zsh (it's just awesome ![]()
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