An oplock (opportunistic lock) is a lock placed by a client on a file that resides on a server. In most cases, a client requests an oplock so it can cache data locally.

This may present a problem in certain types of backups whereby a locked or unreleased file can interfere with subsequent backups. If the backup client is disconnected improperly, the file may remain locked by the NAS. You may receive errors such as:

A file cannot be accessed because it is being used by another process.

Altaro usually recommends that oplocks be disabled on the target backup NAS. Below are instructions for disabling oplocks on TrueNAS SMB shares.

Log in to TrueNAS as root and navigate to services –> SMB and click on the edit configuration icon.

 

image

 

Select advanced options and in the auxiliary parameters, type oplocks=false.

You can also specify certain file types to be excluded:

 

veto oplock files = /myDB.mdb/*.mdb/*.ext/

Above: example using wildcard, filenames or where “ext” are the file extensions.

image

Click the save button then reboot the NAS.

Leave a comment

Your email address will not be published. Required fields are marked *

error: Sorry, copy/paste is disabled
Skip to content