LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-21-2006, 04:21 PM   #1
Sigh
LQ Newbie
 
Registered: Feb 2005
Location: Toronto
Distribution: Red Hat
Posts: 9

Rep: Reputation: 0
Question 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!!
 
Old 09-21-2006, 11:46 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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
 
Old 09-22-2006, 12:01 AM   #3
Sigh
LQ Newbie
 
Registered: Feb 2005
Location: Toronto
Distribution: Red Hat
Posts: 9

Original Poster
Rep: Reputation: 0
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.
 
Old 09-22-2006, 05:36 AM   #4
penguintutor
Member
 
Registered: Jun 2006
Location: UK
Distribution: Ubuntu, Mandriva, Redhat and Fedora
Posts: 118

Rep: Reputation: 15
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.
 
Old 09-22-2006, 07:43 AM   #5
Sigh
LQ Newbie
 
Registered: Feb 2005
Location: Toronto
Distribution: Red Hat
Posts: 9

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't execute a binary file inverted.gravity Linux - General 4 08-07-2006 10:08 PM
/etc/rc.d/rc.6: cannot execute binary file __spc__ Linux - General 11 04-17-2006 11:12 AM
cannot execute binary file babaliciouse Linux - Software 2 10-21-2004 11:50 AM
cannot execute binary file azpeitia Red Hat 2 12-17-2003 12:09 AM
Cannot execute binary file Nooodle007 Linux - Software 2 06-25-2003 01:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration