Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

This is the current fstab entry for the mount.

//qnap/share /data  cifs noauto,user,username=qnap,uid=1000,gid=1000 0 0

This works fine and most of the time without any problems.

However when using some software (eg: basic text editors like gedit, or more advanced apps like PhpStorm) to open files on the share, the software reports "external file change notifications" from time to time.

The file timestamp or size doesn't change, and both this computer and the NAS have the same time set by NTP.

Does anybody know what is triggering these "external file change" notifications in basic linux text editing apps such as gedit?

Does anybody know some different mount flags that could help resolve this?

I'm interested in a fix and also interested in learning what is happening at a lower level to trigger these notifications.

Thanks, Dave

share|improve this question

In your fstab, change the line to

//qnap/share /data  cifs username=qnap,password=<your_pass>,_netdev,uid=1000,gid=1000 0 0

Insert your password in place of and also note _netdev. The option _netdev is always recommended for cifs mounts in fstab. This switch delays mounting until the network has been enabled, though excluding this option won't create a problem.

The warning is because you didnt provide the password during the mount.

A similar but slightly different(in the way that the credentials are stored in a file and the file is referenced in fstab) method has been described here.

Edit: Use noauto(like you did), if you wish to mount during login instead of boot. user and sync options are also optional, use them according to your needs.

share|improve this answer
1  
Thanks for the _netdev tip. I had been fighting with network cifs shares sometimes not auto-mounting, and /var/log/boot.log was showing "network not ready" so I needed a way to force the mounts to WAIT until the network was ready (duh!). But I hadn't known about the _netdev option until your post. – rik-shaw Feb 25 '14 at 14:07
    
Glad to know that your problem is solved, I was there once too. ;) – Fr0zenFyr Feb 25 '14 at 14:11
    
We are now using these options (it is a Win 2003 fileserver, Ubuntu 12.04 clients) for the /etc/fstab cifs mounts: iocharset=utf8, nobrl, file_mode=0777, dir_mode=0777 (have server handle permissions) and now _netdev. Unfortunately, this page doesn't mention many of these options so it has been a lot of hunting to sort it out: wiki.ubuntu.com/MountWindowsSharesPermanently PS: unfortunately I can't seem to make new paragraphs in this comment, so sorry for the formatting! – rik-shaw Feb 25 '14 at 18:21
    
Did this actually work for you with CIFS? According to help.ubuntu.com/community/Fstab: "_netdev - this is a network device, mount it after bringing up the network. Only valid with fstype nfs." – lmeurs Aug 26 '15 at 17:39
    
@Imeurs Yes - it works perfectly fine. If you are looking for official documentation, check this section on wiki. Nevertheless, I wonder why would they not include anything about CIFS anywhere on the link you pointed at... – Fr0zenFyr Aug 27 '15 at 7:23

I have the same problem with Pluma (MATE Desktop's Gedit fork); it seems to be caused by difference in resolution of file modification timestamp between local GNU/Linux machine (nanosec) and remote Windows machine (~2 sec for FAT32).

When Pluma finished writing the file, it queried and remembers modification timestamp of the file; in CIFS case, this information is cached (thus show the original nanosec time). But when time passed, cached attributes expired, and Pluma tried to check file's timestamp for external modification again, it would now get the server-side timestamp (which is rounded up to 2-sec resolution); Pluma interprets this as external modification, and displayed the warning.

I worked around this by stopping CIFS from caching file attributes: specifying actimeo=0 option in fstab:

//qnap/share /data  cifs noauto,user,username=qnap,uid=1000,gid=1000,actimeo=0 0 0

So when Pluma saves the file and read the timestamp, it will always get the already-rounded server-side timestamp, and stops giving the annoying message.

share|improve this answer

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.