LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-16-2012, 10:17 AM   #16
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908

I imagined that as a possibility, but I don't like making suggestions based on suppositions. Asking for all of the information serves to prevent dead-end approaches and also forces the OP to consider the full problem domain. It should be possible to download the file with Windows in a way does not corrupt the file.
It still isn't clear to me whether the OP needs help with downloading to the USB stick, or copying from the USB stick to the Linux host, or both (or neither).
--- rod.

Last edited by theNbomr; 11-16-2012 at 10:19 AM.
 
Old 11-16-2012, 10:37 AM   #17
carltonp
Member
 
Registered: Nov 2012
Posts: 69

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by theNbomr View Post
I asked how the file got on the USB drive. If it got there by downloading it from another host, then a binary mode file transfer would be required. Instead of using FTP, the more modern method would be to use scp, in which there needs to be no distinction paid to binary vs. text modes. All transfers are 'binary' mode.
--- rod.
Thanks for responding. I'm not familiar with scp - would it still require me using two computers in the way I would need two computers for ftp transfer.

I think I may have confused some of the people here that are trying to help me. So let me be clear on what is happening.

I have file called DBConfig_RHEL_SAM_10_0_R5.bin which is my usb drive. The file was originally copied from a windows OS onto the usb stick. I have then copied the file from the usb stick to Linux. When attempt to run the file in linux I get the message that I opened this question with which includes the following:
Please try to download the installer again and make sure that you download using 'binary' mode. Please do not attempt to install this currently downloaded copy.

I was told by a few Linux experts that I needed to ftp the file from the usb to the Linux workstation as that would ensure that it would be downloaded in binary mode.

Can someone please confirm if that is necessary or not?

If scp doesn't require me having to set up two computers to download the file in binary that would be great. Can someone please confirm

Cheers

Carlton
 
Old 11-16-2012, 11:16 AM   #18
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
You have already seen that the file can be copied between the USB stick and the host OS filesystem. It doesn't matter whether the host OS is Windows or Linux. I explained that in article #14 of this thread.
So, please clarify whether you need help with the transfer from some network host to the USB stick, or from the USB stick to your Linux host, or both.
--- rod.
 
Old 11-16-2012, 11:53 AM   #19
carltonp
Member
 
Registered: Nov 2012
Posts: 69

Original Poster
Rep: Reputation: Disabled
Hi Nbomr,

I need help transferring from the USB stick to my linux host please...

Cheers mate.
 
Old 11-16-2012, 01:21 PM   #20
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by carltonp View Post
I have file called DBConfig_RHEL_SAM_10_0_R5.bin which is my usb drive. The file was originally copied from a windows OS onto the usb stick.
How did it get onto the Windows box? Presumably by an FTP client that was in text mode? The file was probably corrupted at that stage and no amount of fiddling with a usb stick is going to help.
 
1 members found this post helpful.
Old 11-16-2012, 01:27 PM   #21
carltonp
Member
 
Registered: Nov 2012
Posts: 69

Original Poster
Rep: Reputation: Disabled
ntubski,

To be honest I'm presuming that it was copied from a windows OS onto the usb stick. If after downloading it in binary mode and it still doesn't work I'll call it quits and accept its corrupt...
 
Old 11-16-2012, 03:53 PM   #22
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Does the story look like this:
Code:
               FTP download
               (text mode)                   copy file              copy file
FTP Server  -----------------> Windows Box  -----------> USB stick -----------> Linux Box
Generally a simple "copy file" operation shouldn't cause corruption because it always does the equivalent of binary mode; there is no "copy file in text mode". You have to redo the download from the FTP server in binary mode.

Quote:
I was told by a few Linux experts that I needed to ftp the file from the usb to the Linux workstation as that would ensure that it would be downloaded in binary mode.
It doesn't make sense to ftp a file from a usb, but perhaps "from the usb" is only being used to identify the file being talked about? However, even then I don't believe that running an ftp client from a Linux box will necessarily ensure binary mode.

Quote:
If scp doesn't require me having to set up two computers to download the file in binary that would be great. Can someone please confirm
Using scp implies copying from one computer to another.
 
Old 11-16-2012, 05:03 PM   #23
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
If you did the ftp to get it to the USB then the issue is almost certainly the difference between binary and ascii that I discussed in original reply.

As others have said a simple copy (DOS/Windows) or cp (Linux/UNIX) should not affect the format of the file.

Also scp and sftp use ssh transport and don't have the same binary/ascii issues as standard ftp.

The question is how did the file initially get to the USB? If it was copied from another machine that you plugged the USB into the question would be how did the file get to that machine?
 
Old 11-16-2012, 05:42 PM   #24
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
to cross out a few variables i would start at the begining. if you have ssh access to the server, then it is preferable to use scp rather than the old, antiquated and insecure ftp. if you have to use ftp, then be triplely sure that it is set to binary mode transfer.

also, i am not sure why there is a dependancy on a usb disk. it would be less complicated to just download the file on the linux machine. if you have to sneakernet it, then just drag-and-drop the file.

Last edited by schneidz; 11-16-2012 at 06:07 PM.
 
Old 11-16-2012, 06:50 PM   #25
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Plug the USB stick into the USB port of your Linux host. Most likely it will be automatically mounted, possibly under /media or /mnt. Use cp to copy the file to an appropriate place on the filesystem. You may need to elevate to root or use sudo to gain access to the directory upon which the USB stick is mounted. It is possible that plugging the USB stick into the USB port will result in some kind of filesystem browser being launched on the GUI desktop. If so, you can use that to drag the file to a local disk directory of your choice.

If you aren't sure whether the USB stick is mounted, run mount, and it should list all mounted filesytem, including their mountpoints. If it isn't mounted, run fdisk -l (lower-case ell), and it should display the device name, which you can then use to mount the device on an appropriate mountpoint.
Code:
man mount
If you still get no joy, come back here for more help.

--- rod.
 
Old 11-17-2012, 06:39 AM   #26
carltonp
Member
 
Registered: Nov 2012
Posts: 69

Original Poster
Rep: Reputation: Disabled
First, I want to say thank you all for sticking with me to resolve this issue.

Quote:
Originally Posted by theNbomr View Post
Plug the USB stick into the USB port of your Linux host. Most likely it will be automatically mounted, possibly under /media or /mnt. Use cp to copy the file to an appropriate place on the filesystem. You may need to elevate to root or use sudo to gain access to the directory upon which the USB stick is mounted. It is possible that plugging the USB stick into the USB port will result in some kind of filesystem browser being launched on the GUI desktop. If so, you can use that to drag the file to a local disk directory of your choice.
Doing the above results in the following after running the file:

[root@localhost ThisLinux]# ./DBConfig_RHEL_SAM_10_0_R5.bin
bash: ./DBConfig_RHEL_SAM_10_0_R5.bin: /bin/sh^M: bad interpreter: No such file or directory


I then add the following to fix the /bin/sh^M

:set fileformat=unix
:wq!

After doing the above I get the following:

-bash-4.1$ ./DBConfig_RHEL_SAM_10_0_R5.bin
Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...

gzip: /tmp/install.dir.3691/Linux/resource/vm.tar.Z: corrupt input. Use zcat to recover some data.
./DBConfig_RHEL_SAM_10_0_R5.bin: line 609: uncompress: command not found

gzip: /tmp/install.dir.3691/Linux/resource/vm.tar.Z: corrupt input. Use zcat to recover some data.
The included VM could not be uncompressed (GZIP/UNCOMPRESS). Please try to
download the installer again and make sure that you download using 'binary'
mode. Please do not attempt to install this currently downloaded copy.

The above is why I'm having to download the file from the usb in binary mode.

Cheers
 
Old 11-17-2012, 08:32 AM   #27
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
those caret-M's (^M) means that the file has microsoft line endings. is it possible to download the file directly to the linux machine to mitigate the possibility of introducing errors from the microsoft machine ?

i never heard of this command :set fileformat=unix (was this done in vi ?) but judging by its name its supposed to change the ms cr-lf's to unix lf's.

it seems it is looking for a program called uncompress. i dont have it on my system so i dont know how to install it (maybe making a link to gunzip will do: 'ln -s /usr/bin/gunzip /usr/bin/uncompress').

youre not doing a good job explaining what you are trying to do and what you have done so far so that is why you are not getting the specific help you need... it seems like we are all taking stabs in the dark trying to help you.

Last edited by schneidz; 11-17-2012 at 08:34 AM.
 
Old 11-17-2012, 08:47 AM   #28
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
On Slackware 13.37, uncompress is /usr/bin/uncompress which is a symlink to /usr/bin/compress, installed as part of the ncompress 4.2.4.3 package during Slackware installation. The uncompress man page includes "Compressed files can be restored to their original form using uncompress or zcat".
 
1 members found this post helpful.
Old 11-17-2012, 08:56 AM   #29
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
thanks, this is in fedora.
Code:
[schneidz@hyper dx2]$ sudo yum install compress uncompress ncompress
Loaded plugins: refresh-packagekit
Setting up Install Process
No package compress available.
No package uncompress available.
Resolving Dependencies
--> Running transaction check
---> Package ncompress.x86_64 0:4.2.4-56.fc15 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                         Arch                         Version                             Repository                     Size
======================================================================================================================================
Installing:
 ncompress                       x86_64                       4.2.4-56.fc15                       updates                        25 k

Transaction Summary
======================================================================================================================================
Install       1 Package(s)

Total download size: 25 k
Installed size: 31 k
Is this ok [y/N]: n
Exiting on user Command
Complete!
 
Old 11-17-2012, 09:22 AM   #30
carltonp
Member
 
Registered: Nov 2012
Posts: 69

Original Poster
Rep: Reputation: Disabled
Hi Schneidz

I tried installing the compress package and I got the following output:

[root@localhost ~]# sudo yum install compress uncompress ncompress
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
No package compress available.
No package uncompress available.
No package ncompress available.
Error: Nothing to do
[root@localhost ~]#

Can you please let me know what I need to do to install the uncompress package successfully?

Cheers

Carlton
 
  


Reply



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
[SOLVED] Converting a binary file from little endian to big endian jaepi Programming 6 09-05-2011 09:51 PM
'Cannot Execute Binary File' issue kickout Linux - Software 4 09-16-2010 10:54 PM
Tar archive from windows to linux, binary file issue jblevins Linux - General 3 04-13-2009 11:50 PM
converting a hex file to binary linx win Programming 3 07-20-2006 03:04 AM
j2sdk installation issue - cannot execute binary file mcolley73 Linux - Software 2 04-18-2004 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:24 AM.

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
Open Source Consulting | Domain Registration