LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Cannot execute binary file (https://www.linuxquestions.org/questions/linux-server-73/cannot-execute-binary-file-485783/)

Sigh 09-21-2006 04:21 PM

Cannot execute binary file
 
Scenario:

We have a backup tape from a client's server and are trying to recover a program & data. The progam and all relevant / required files are contained within one directory.

We have restored the directory from the tape onto our own linux box. The client was running RH 7, and we have tried this on both an RH 7 and RHEL 3 box.

We have verified that ownership and permissions are set correctly.

[root@dhcp999-999 acme]# ./acme
bash: ./acme: cannot execute binary file

[root@dhcp999-999 acme]# file -z acme
acme: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV) (compress'd data 13 bits)


What does this mean? How can I get this program to run again?

Thanks in advance!!

paulsm4 09-21-2006 11:46 PM

Hi -

The "compress'd" part of the message concerns me. I was surprised to see that if I compressed an executable, "file -z" would still report the correct type ("ELF 32-bit LSB executable...) - even for a .Z or .gz.

Is it possible that your client's tape was a compressed archive, and perhaps you should re-extract with "tar -z" or "tar -j" (as approopriate)?

Just a thought .. PSM

Sigh 09-22-2006 12:01 AM

Interesting thought ... the files and directories are as they should be. The executables have no extension (acme not acme.z).

It might be interesting to try unzipping them or something.

penguintutor 09-22-2006 05:36 AM

Code:

[root@dhcp999-999 acme]# file -z acme
acme: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV) (compress'd data 13 bits)

Quote:

I was surprised to see that if I compressed an executable, "file -z" would still report the correct type ("ELF 32-bit LSB executable...)
That is the function of the -z option to the file command. Without -z the file command will just say it is a compressed file, but with the -z option it actually looks at what the compressed file is.

If the file was compressed with gzip then it would normally say gzip compressed file, so I suspect it was created using the older compress command or similar. gzip can handle different compression formats so I suggest you try renaming to add .Z on the end and then try gunzip'ing the command and see if that works.

Sigh 09-22-2006 07:43 AM

Quote:

Originally Posted by penguintutor
Code:

[root@dhcp999-999 acme]# file -z acme
acme: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV) (compress'd data 13 bits)



That is the function of the -z option to the file command. Without -z the file command will just say it is a compressed file, but with the -z option it actually looks at what the compressed file is.

If the file was compressed with gzip then it would normally say gzip compressed file, so I suspect it was created using the older compress command or similar. gzip can handle different compression formats so I suggest you try renaming to add .Z on the end and then try gunzip'ing the command and see if that works.

You're bang on. Someone else just gave me the same advice a little while ago and I'm seeing limited success so far. I'll let you know how it works out.


All times are GMT -5. The time now is 03:37 AM.