LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 08-21-2006, 03:29 PM   #1
Cottsay
Member
 
Registered: Feb 2004
Location: Chaska, MN
Distribution: Fedora
Posts: 195

Rep: Reputation: 31
Question Samba on NFS File Locking


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.

Thanks,

Scott K Logan
CottsayNet
 
Old 08-21-2006, 03:53 PM   #2
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
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).
 
Old 08-21-2006, 11:47 PM   #3
Cottsay
Member
 
Registered: Feb 2004
Location: Chaska, MN
Distribution: Fedora
Posts: 195

Original Poster
Rep: Reputation: 31
alright...well I need NFS because it maintains rights between systems...can sshfs do that? I know samba doesn't work that way...
 
Old 08-22-2006, 08:34 AM   #4
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
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.
 
Old 01-26-2012, 06:15 AM   #5
tha.siegrist
LQ Newbie
 
Registered: Jan 2012
Location: Bern, Switzerland
Distribution: SuSE Ubuntu RedHat AIX HP-UX
Posts: 3

Rep: Reputation: Disabled
Solution

Samba works on NFS-Shares if you switch off strict locking in smb.conf

[global]

strict locking = no
 
Old 07-28-2015, 02:23 AM   #6
Robert.TreBor
LQ Newbie
 
Registered: Jul 2015
Posts: 1

Rep: Reputation: Disabled
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.

cheers,
Robert
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to enable NFS file locking? ahz10 Linux - Networking 2 05-22-2006 11:34 AM
Samba/NFS locking up. - HELP - grenobel Linux - Networking 0 02-25-2005 10:33 AM
file locking problem with samba mpriddy Linux - Software 4 11-29-2004 04:00 PM
Samba / File locking question mfeoli Linux - Networking 5 04-13-2004 04:06 PM
File locking over Samba rtaft Linux - Software 0 12-30-2003 11:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration