Follow

Files getting locked frequently on SMB shares

Subject:

If services are not down, file locking can be a normal mechanism of SMB services.

There are several things that you can investigate to address file locks with SMB.

1) Kill the particular process locking the files.
2) Restart the CIFS/ share services completely.

 

Detail:

Normally, you will see file locks for a reason.

A file should not be modified while another user is using the same file. However, if you 100% know that this is in error at the moment, you can restart the SMB service on the machine in questionby using the following stesp:

Go to "Network Shares" on the left side of the Web UI, then at the top click "Restart NFS/SMB Services...". Then select the affected system, select the checkmark for 'Restart CIFS/SMB Service', then press 'OK'.

A better option (more granular), if you know file name, is running the following from the shell as root:


~# smbstatus | grep -i <file name> | awk '{print $1}'

 

This will give the pid of the process locking the file. At this point you can either kill the process and try again or you can check which user is causing this condition by running:

To kill the process:

~# kill $(smbstatus | grep -i 'VDC1DBOLTP01_AppSupport.BKP' | awk '{print $1}')

 

To check the userID:

~# smbstatus | grep pid

 

It should be noted that this is very likely a client-side issue as a locked file on the NAS side is almost always a normal circumstance and routine part of operating an SMB share.

 

Please review this link for additional detail:

Restart_NFS_Services

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk