LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   md5sum is wrong (http://www.linuxquestions.org/questions/linux-software-2/md5sum-is-wrong-481855/)

ISummers 09-09-2006 08:16 AM

md5sum is wrong
 
Hi,
When I ftp a large file 600M Oracle to my Linux server from my XP pc that I downloaded it to, the md5sum seems to give the wrong answer.

For instance.

1. fsum on my XP pc gives the correct answer as stated by Oracle.

2. Copy to Linux server.

3. Run md5sum (result may be good or bad)

4. When good result, I then copy to another disk and recheck. Result is wrong! Then check the original "right" copy on the Linux server and that gives me a wrong number when the last time I ran it the number was correct. What the "f" is going on?

Do I have a bad md5sum that somehow touches/changes the zip file?

Regards,
Ian

MensaWater 09-09-2006 08:44 AM

When you start the ftp make sure you type "bin" after login to tell it is a binary rather than an ASCII transfer.

Unix/Linux and Dos/Windows have different end of lines so an ASCII transfer from one to the other will usually change these end of line. A binary transfer tells it to transfer as is with no conversion.

matthewg42 09-09-2006 11:13 AM

Try another transfer method and compare the results. It's likely that the bin thing mentioned above is the problem. Try using scp or sftp and see if the file is still corrupted. scp and sftp are modern, secure alternatives to rcp and ftp.

They are better in that they encrypt data as it goes over the network, and the password for the account is also encrypted. FTP sends the password in the clear so that someone who is sniffing your network traffic could easily get it.

There is of course a penalty for the encryption - some extra setup, although this should be more or less automatic on modern liux distros. You also get a higher CPU load. If the network is very fast and you are sending a lot of data, an scp/sftp connection can easily hog a lot of your CPU cycles.

I once worked at a project where we transferred gigabytes of data every night using rcp over a very fast network - multiple files in parallel. We switched to scp for the security and found that it had a really big hit on CPU resources.

I still favour using the s tools though, despite the CPU load. security security security!


All times are GMT -5. The time now is 01:57 PM.