Hey everyone! I'm having a bit of an issue with my NAS setup. I've got a TrueNAS system where I'm sharing a dataset with both a Linux server via NFS and a Windows PC using SMB. The problem I'm facing is that when I update a file on my Windows machine, it can take anywhere from 20 seconds to 2 minutes for the changes to reflect on my Linux server. I really need the updates to be instantaneous for my workflow. I'm currently mounting it on Linux with this command: `sudo mount -t nfs xxx.xxx.xx.x:/mnt/storage/test /home/me/test/`, but I can't use `lookupcache=none` because it slows everything down way too much. Any suggestions on how to fix this syncing problem?
4 Answers
Have you checked both the export options on your NAS and the mount options on the client? It might help to try mounting with the 'cto' option, and also clear the cache by running `echo 3 > /proc/sys/vm/drop_caches` after creating files to see if that affects the syncing speed. If all else fails, use tcpdump or Wireshark to investigate when the data is being sent to the server.
I think the delay could also be coming from the Windows side rather than NFS. After writing files on your PC, can you access them directly on the NAS right away? Check your Samba configuration on the NAS; sometimes settings there can cause delays in how data is written over SMB.
Just so you know, exporting the same dataset via both NFS and SMB can lead to data corruption issues. Even if the dataset is read-only, you're likely to face delays when updating files over these two different protocols. My advice? Stick to just Samba for better consistency!
Hey! You might want to check the options you're using for your NFS mount. If it's set to async, it could be buffering writes on your local machine before sending them to the server. Try remounting with the sync option using `mount -oremount,sync /mountpoint`. This will force the updates to be written immediately, which might help with the lag you're experiencing. Just a heads up, using sync could affect the performance of other tasks on the server, so keep an eye on that!

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures