How to prevent samba from holding a file lock after a client disconnects?

the below steps have helped me resolve this exact issue on a number of occasions:

  1. Login to the samba server.
  2. Run a “smbstatus”.
  3. Find the pid of the process that has the lock on the file
    in the third section of the output.
  4. Verify that it matches the expected user and hostname
    in the first and second sections of the smbstatus output.
  5. Run “ps -ef” and see how long the smbd with that pid has
    been running.
  6. If it has been running since before the computer was last
    rebooted, it’s a left over smbd. Kill JUST THAT ONE smbd.
    (And make sure you get the right one — it should be one
    that has a parent pid not equal to 1.)

Leave a Comment