Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Under Ubuntu, I use smb to mount the directory of the server(Ubuntu too), and set to a local directory, like /home/username/server. When I change some files of local directory, the files in the server change too. However, when I change some files of the server, the files in local directory don't change.

Does someone know what the reason is ? And could someone fix it and make local changes updated to the server so that I could edit local and make in the server?

I use mount.smbfs. Besides, after changing to mount.cifs, it is all the same. However, there is no cache option in my mount.cifs version.

share|improve this question
why oh why are you using SMB for connecting one Ubuntu box to another? Do yourself a favor and use NFS, it is native, simpler and much faster. As for your question, what software are you using to do the sync? SMB itself doesn't sync, so there are some vital pieces missing from your question that will be required to know in order to answer it. – MaQleod Sep 24 '12 at 3:53
@MaQleod: NFS is definitely not as simple to set up... – grawity Sep 24 '12 at 8:16
See my answer here for instructions on setting up NFS. – terdon Sep 24 '12 at 10:40

In my situation, I have to connect to the server, and I don't have root permission, so deploying NFS may not work for me. The administrator may not install it.

This way, I don't have to install any other software, just install SMB, then in the file directory, input smb:// to visit the server files.

I use mount command with smbfs to map the server files to local directory. The command is like this:

mount -t smbfs -o rw,username=xx,password=xx,gid=xx,uid=xx server/dir local/dir
share|improve this answer

The local computer (SMB client) caches accessed files. If you use mount -t cifs, try adding cache=strict, strictcache or cache=none to the mount options.

share|improve this answer

I have had this problem recently. I continually read a binary file on the server, and it was updating very sporadically (sometimes not at all). I fixed this behaviour by adding the directio switch into the options used in my fstab.

Here is the line in my fstab now:

//server/share /mnt/smbmount cifs credentials=/root/secure/cred,directio 0 0
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .