Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
1  
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
add comment

3 Answers

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://xxx.xxx.xxx.xx/ 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
add comment

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
add comment

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.

http://manpages.ubuntu.com/manpages/oneiric/man8/mount.cifs.8.html

Here is the line in my fstab now:

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.