4

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.

3
  • 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, 2012 at 3:53
  • @MaQleod: NFS is definitely not as simple to set up... Sep 24, 2012 at 8:16
  • See my answer here for instructions on setting up NFS.
    – terdon
    Sep 24, 2012 at 10:40

3 Answers 3

2

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
0

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.

0

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

You must log in to answer this question.

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