0

I have a fileshare on Windows 7 that I'm accessing from a linux (ubuntu lucid) virtual machine running in VirtualBox.

When I change a file in windows, then don't access it for a while (an hour or two or more) in the linux filesystem, it either uses the old/unchanged version of the file, or it uses a truncated or corrupted version of the file.

I'm using fstab and cifs, and haven't had any other problems.

Running mount -a doesn't update the caching - I'm not really sure whether it's caching at the windows side or linux.

The two actions that update to the newer version of a file are: - restarting the linux virtual machine - resaving the file with a different filesize

Is there a way to turn off or improve the caching?

I had a look through the Win7->folder->Sharing settings, and couldn't see anything useful there.

Redzarf
  • 131
  • 3
  • 1
    It's quite likely to be cached by the `cifs` filesystem on Ubuntu. (You can always use Wireshark to make sure.) – user1686 Mar 23 '11 at 16:24
  • @Grawity - post that as an answer. – mfinni Mar 23 '11 at 21:20
  • So I looked at the cifs caching more, and you can turn it off with the forcedirectio option: [link](http://www.cyberciti.biz/tips/disable-caching-on-the-cifs-nfs-client.html) After a day of use it seems like it's working. – Redzarf Mar 25 '11 at 14:32

1 Answers1

0

Windows filesharing probably isn't doing this. What format is the file? The application on one side or the other may be mangling the file when it's changed by one.

mfinni
  • 35,711
  • 3
  • 50
  • 86