Posts Tagged ‘CIFS’

Copying large files to CIFS mount (XP) may corrupt data!?

Thursday, March 8th, 2007

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. :(

Fedora Core 6 – CIFS Problems RESOLVED

Wednesday, November 15th, 2006

This week the Fedora folks released A LOT of updates for Core 6. Among them was an updated kernel and thankfully, it addressed one of the problems I blogged about in this post.

I can now mount CIFS shares to a genuine mount point and access them via the GUI or the command line. This REALLY makes my day. Its now possible to transfer files to my home machine, update them and send em’ back. Hallelujah!

The annoying SATA startup probe hasn’t been resolved. I suppose I’ll suffer with this a while longer. I should probably take some initiative and register a bug report.

In other news, I finally know how to view the changelogs on a Fedora box. I should have read a little more on the rpm command, I might have known about it sooner…

Entering rpm -q kernel-2.6.18-1.2849.fc6 –changelog |less displayed the changelog for the current kernel. Seems the CIFS fix was implemented on November 9th.

Fedora Core 6 – SATA & CIFS Problems

Thursday, November 9th, 2006

I’m having two problems with my FC6 install at work (I’m running a Dell OptiPlex GX270, ya know, a basic office machine). One of the issues is more of an annoyance, the other limits my capabilities and I’m bothered that it’s still a problem on this machine.

The lesser of the issues causes slow boot times. While the kernel is loading and before the GUI boot screen, Linux is probing my SATA ports and not finding any drives. That makes sense since there aren’t any SATA drives in this box. I found 2 posts about this issue on Red Hat’s bugzilla, ID 212581 & ID 212737, I see no confirmation of the problem, so who knows when there will be a fix. Its not really a show stopper as the scan times out, gives up, and eventually boots normally.

This issue is the bugger! CIFS mounts with roughly 100 or more files cannot be read. If you’re unfamiliar with CIFS, its the filesystem type used when mounting Samba/Windows shares. As I’m using this machine at work, this one makes me growl. I have up to 15 shares I need to mount from time to time in order to get my work done. Most of them have well over 100 files just in the root of the share. When attempting to navigate offending mounts with Nautilus, I receive an error that reads “The folder contents could not be displayed“. The error I receive when trying to list the contents of the folder via the command line reads “ls: reading directory .: Invalid argument”. This is a real problem for me as I’m responsible for a lot of documentation, I sort them by directory, I have thousands of folders/files (I’m anal about it and document everything) and I can’t access them through file system mounts.

There is a workaround, I can mount using Gnome VFS (Places > Connect to Server), and I can browse using Nautilus (smb://server/share). This isn’t ideal, I would prefer to have a genuine mount. Not all programs are Gnome VFS aware and I don’t see a way to direct Gnome to mount to an actual file system location. That means that if I create a file with an app that can’t utilize Gnome VFS, I need to save the file to my home dir and then copy it off to the VFS mount. If you know of a way to force VFS mounts use a genuine mount point, PLEASE let me know.

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=212123 says that this problem has been fixed in CVS and an update will be released shortly. That was posted on October 28th and I still haven’t seen an update addressing the issue.

When Looking at this from a Linux newbie point of view (and I do know that Fedora isn’t a newbie focused distro) this is a real problem. There is no fix for the CIFS problem, well, not unless you want to compile your own kernel from CVS (and that’s nothing more than a drug store chain to many people new to Linux) and the potential fix listed for the SATA problem (mentioned in bug 212581) isn’t something a newb would/should be comfortable doing. If I was just giving Linux a shot and started out with Fedora I might be tempted to just say that Linux is broken and go back to Windows.