Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
For a long time I've mounted Samba shares (on my Samba PDC) on an NFS share located on a storage system. (so theres a folder on my NAS server which is mounted via NFS on my PDC which is mounted via Samba on the Windows computer beloning to the domain). Recently, I started getting this message while trying to write a file that is mounted in such a mannor:
The process cannot access the file because another process has locked a portion of the file.
This only happens on the NFS/Samba shares. It works fine if the folder on the PDC isn't mounted via NFS. I can copy files to the NFS folders just fine from the PDC's command shell. It worked before...an update maybe? Any help is appreciated.
NFS is known for having locking problems. That is why it is never used for shared directories. Usually you would mount an NFS directory read only or as a home folder where only one user can open and lock each file.
I recommend dropping NFS and using only Samba shares. Samba handles file locking very well and it also has user authentication whereas NFS handles only host based authentication. Plus Windows utilities for NFS are very rare and poor in design.
Samba is called The NFS Bloodbath. NFS has litteraly been fazed out by Samba. Another very promissing file sharing method is sshfs which is user based and with high encryption (excellent sharing directories over WAN connections).
Samba does maintain file permissions as far as I can remember. You can also change the umask of each shared folder so that only the user that created the file has rights to it or so that the entire group has rights. You should really try Samba and drop NFS, especially if you are sharing the remote folder. sshfs should also work with permissions and you can even use it securely over the Internet. Though it only works on the kernels Linux 2.4, 2.6 and FreeBSD.
Switching off strict locking in samba did not help us with the issue in that it solved the consecutive lock issue, but generated another of files not being updated.
What helped us was changing the way we mounted the NFS share by adding "nolock" to the NFS mount options. Thought this might be useful to someone.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.