October 11, 200817 yr Occasionally I have a machine go down while writing to the unRAID server (usually to the cache disk). On reboot, the file it was writing to is frequently locked and cannot be deleted. It makes it hard to resume copying. I've tended to just ignore it and the next day find that I can delete it. Is there is a way to force a file to be closed so that it can be deleted.
October 11, 200817 yr Author I don't think I asked my question very well. I had a WINDOWS workstation copying a large file to the unRAID server. The Windows workstation crashed. The file it was writing is now locked on the unRAID server, even after the Windows workstation comes back online. I believe if I wait several hours the lock will get dropped. Is there a way to get unRAID to release to lock sooner without rebooting the unRAID server?
October 11, 200817 yr I don't think I asked my question very well. I had a WINDOWS workstation copying a large file to the unRAID server. The Windows workstation crashed. The file it was writing is now locked on the unRAID server, even after the Windows workstation comes back online. I believe if I wait several hours the lock will get dropped. Is there a way to get unRAID to release to lock sooner without rebooting the unRAID server? You can kill the smbd process that has the file locked Log in via telnet, type: smbstatus It will type a listing of the locked files, looking similar to the listing below: Samba version 3.0.28a PID Username Group Machine ------------------------------------------------------------------- 2549 joe joe dell630 (192.168.2.10) Service pid machine Connected at ------------------------------------------------------- flash 2549 dell630 Tue Oct 7 22:54:23 2008 Locked files: Pid Uid DenyMode Access R/W Oplock SharePath Name Time -------------------------------------------------------------------------------------------------- 2549 0 DENY_NONE 0x100001 RDONLY NONE /boot . Tue Oct 7 22:55:43 2008 The "pid" of the smbd process holding the locked file is given in the output. In my case, /boot is locked by process ID 2549. I can then type ps -ef | grep smbd to see what process is holding the lock. (It will be an smbd process) ps -ef | grep smbd root 1790 1 0 Oct01 ? 00:00:01 /usr/sbin/smbd -D root 1791 1790 0 Oct01 ? 00:00:00 /usr/sbin/smbd -D root 2549 1790 0 Oct07 ? 00:03:19 /usr/sbin/smbd -D root 20032 22786 0 23:26 pts/1 00:00:00 grep smbd Lastly, you can kill the process holding the lock. Type (using your process ID) kill 2549 Here is what happened when I did that on my server [pre] root@Tower:/boot# kill 2549 root@Tower:/boot# smbstatus Samba version 3.0.28a PID Username Group Machine ------------------------------------------------------------------- Service pid machine Connected at ------------------------------------------------------- No locked files [/pre] The lock is gone... Have fun... Joe L.
October 11, 200817 yr Author By the time I got this note, the lock had been dropped. Thanks for the instructions. I'll try it next time this happens.
November 3, 20223 yr Hi, even it's a very old thread i have to thanks Joe L. ! After three times it's save me from wait the auto unlock of files... (unraid 6.11.1 here, unraid hang while move is in action with shfs very high cpu usage, as a result some open files are blocked) Edited November 3, 20223 yr by cb
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.