Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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.
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.
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...
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.
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?
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.
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.
First, I want to say thank you all for sticking with me to resolve this issue.
Quote:
Originally Posted by theNbomr
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.
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.
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".
[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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.