Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Locked File

Featured Replies

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.

Try deleting the share from the Windoze box before unraid reboots.

 

  • 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?

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.

  • 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.

  • 14 years later...

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 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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.