Samba: The process cannot access the file because another process has locked a portion of the file
Category : How-to
Whilst you could argue that it is not efficient to share storage this way, sometimes there is a valid need.
The error was displayed when creating a none empty file, or copying a non zero byte file to the storage. The error is displayed, in my case in Windows, in a dialogue box.
The process cannot access the file because another process has locked a portion of the file
To fix this issue we need to open the smb.conf file on the Samba server
In the general section of the smb.conf (that is usually the part at the top of the file) add “strict locking = no“. An example of how your smb.conf file may look is below.
netbios name = sambaserver
workgroup = JAMESCOYLE
security = user
encrypt passwords = yes
strict locking = no
comment = %u's Home Directory
browsable = no
read only = no
When strict locking is disabled, the NFS server will only lock the file when the client tells it to. When it is enabled, the NFS server locks the file on every read and write.