I’ve been being extremely careful with my files, I’m not 100% convinced that moving files between my Linux and Windows machines via Samba is flawless. As it turns out, there is a problem…
I’m copying FC-6-i386-DVD.iso, which is 3.3G (3525195776 bytes) from my home dir to a Samba share (hosted by a fully patched XP box). Before I copy the file, I create an md5 sum of the ISO. After the copy, I compare the file to the sum and it always fails
I can transfer the file from the Linux box to the XP box via FTP without issue. So what the hell is happening when I copy it to the box via Samba? The only difference I’m seeing is that the date and time on the file after the transfer has changed. That’s perfectly normal. Just comparing the file sizes doesn’t tell me anything, they match. The only indication that there is a problem with the file is that the md5 hash is not passing.
It’s not just this file either, it seems that most but not all (???) large files fail when I check them after copying. It also seems to be limited to this install (Edgy). For fun, I tried mounting the same share using the same options (rw,guest,file_mode=0660,dir_mode=0770,uid=<myuid>) and was able to transfer a large file from a machine running Dapper without issue. Both machines seem to be running the same versions of the samba tools. This is FRUSTRATING.
Before I post this, I’m going to poke around and see what I can find out about the issue.
…………………………… (<– those dots are an indication of time passing)
Well! I think I have a work-around. I ran the command dmesg and found “alotta” errors that read “CIFS VFS: No writable handles for inode”. I popped that into Google and found this page with a “fix”. I remounted the share with the “forcedirectio” option and things seem to be working as expected! Damn glad I found this. I’ll continue to monitor my copies for a while, but at the moment I feel pretty good about the fix.
Here’s what scares me, how many people are ending up with damaged files and don’t know it? I haven’t tested the ISO I used in the example after learning that it failed verification, for all I know it’s useless. What if somebody is copying files from his Linux box to his Windows box for backup? How many people are using md5 to compare files copied across the LAN? This could be really ugly for some.

Recent Comments