1

I've got a script running on a number of Ubuntu Server 12.04 computers that are all mounted to a single NFS share. When the script completes, it copies the output to the share. Most of the time it works fine, but occasionally it will just create an empty file (of the correct name) that has no permissions and has a modified date of 1971, and then it will return an error cp: cannot create regular file '<filename>': File exists. This is driving me insane!

Here's my /etc/exports file:

/export      192.168.0.0/24(rw,fsid=0,insecure,no_subtree_check,async,no_root_squash)
/export/home 192.168.0.0/24(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
/export/opt  192.168.0.0/24(rw,nohide,insecure,no_subtree_check,async,no_root_squash)

And here's an example /etc/fstab from one of the client machines:

...
192.168.0.254:/home       /home   nfs4    _netdev,auto    0       0
192.168.0.254:/opt        /opt    nfs4    _netdev,auto    0       0
  • just a stab in the dark: do you have read permissions to the file you are trying to copy? – virtualxtc Dec 13 '13 at 18:09
  • Yes, I definitely have read permissions. – KevinC Dec 13 '13 at 18:36
  • Good luck; I've heard of something similar for copying from NTFS over a networks, but NFS should totally work. At a minimum it's worth filing a bug over. – virtualxtc Dec 13 '13 at 21:57
  • I don't know that I've even figured out enough to file a bug. I can't find any useful info in the logs on the host or the clients. – KevinC Dec 14 '13 at 21:21
  • is it repeatable if you copy the same file over? – virtualxtc Dec 14 '13 at 22:43
1

I'm not 100% sure, but I think I figured it out. I noticed that ntp had died on a few of the client machines and their clocks had drifted quite a bit. I fixed this and haven't had the NFS problem since. I'm thinking now that the different file edit times were occasionally throwing things off.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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