NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
BtrieveBill
Aug 09, 2021Aspirant
How do I reset a Windows File Sharing Session to close open files?
Like most of you, I assume, I use a ReadyNAS 516 to store a ton of data. In my case, this also includes my users' Email profiles, which allows them to acecss their Email from any computer on the LAN...
- Aug 10, 2021
BtrieveBill wrote:
So, my question is simply this: How can I close all open files from a single, presumed-dead, connection, without closing ALL open files for all other users?
You should be able to do it using ssh.
smbstatus will give you the list of locked files at the end of the status info. Each entry starts with the process ID (pid) that has that file open. You find the file you want to forcibly close, and then kill the corresponding pid using kill. Killing the process will close all files opened by that pid.
You can reduce the amount of output using smbstatus | grep -i xxxx - in your case, using the profile name (or a reasonably long part of it).
StephenB
Aug 10, 2021Guru - Experienced User
BtrieveBill wrote:
So, my question is simply this: How can I close all open files from a single, presumed-dead, connection, without closing ALL open files for all other users?
You should be able to do it using ssh.
smbstatus will give you the list of locked files at the end of the status info. Each entry starts with the process ID (pid) that has that file open. You find the file you want to forcibly close, and then kill the corresponding pid using kill. Killing the process will close all files opened by that pid.
You can reduce the amount of output using smbstatus | grep -i xxxx - in your case, using the profile name (or a reasonably long part of it).
BtrieveBill
Aug 10, 2021Aspirant
You are awesome, man! Being an old command-line guy from too long ago to remember, this is exactly what I needed.
I just wish that NetGear had the foresight to understand that Windows machines do crash from time to time, and making an open file or connection list available from the GUI (along with a way to clear them out) is also important.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!