F5F Stay Refreshed Software Operating Systems Initiate force disconnection of ISCSI interface.

Initiate force disconnection of ISCSI interface.

Initiate force disconnection of ISCSI interface.

D
drip_133
Member
56
08-11-2017, 05:41 PM
#1
I've experimented with iSCSI for a while (FreeNAS 11.1-U5 target, Windows 10 Pro 1803 initiator). A persistent problem keeps me stuck: I can't disconnect from an iSCSI target no matter what I do. Every method returns the same error—"The session cannot be logged out since a device on that session is currently being used." I've tried several approaches: using the Disconnect option in the Initiator panel, running commands in PowerShell, taking the disk offline via Disk Management, disabling the Microsoft iSCSI Initiator in Device Manager (which needs a reboot), turning off the service in FreeNAS, and even clearing favorite targets and portals in the iSCSI settings. The device isn't active in Windows, so it doesn’t appear to have a file system and can’t be held open by the OS. Ideally, I’d like to disconnect on demand or at least force a clean exit so another machine can connect and then reconnect later. Any suggestions would be greatly appreciated!

Hardware specifics:
- Windows 10 Pro (desktop): Ryzen 5 1600X, 16GB RAM, NVMe boot drive, Mellanox ConnectX-2 (direct link to server)
- FreeNAS Server: Core i3-4170, 32GB RAM, 4×10TB RAIDZ2, Mellanox ConnectX-2 (direct link to desktop)
D
drip_133
08-11-2017, 05:41 PM #1

I've experimented with iSCSI for a while (FreeNAS 11.1-U5 target, Windows 10 Pro 1803 initiator). A persistent problem keeps me stuck: I can't disconnect from an iSCSI target no matter what I do. Every method returns the same error—"The session cannot be logged out since a device on that session is currently being used." I've tried several approaches: using the Disconnect option in the Initiator panel, running commands in PowerShell, taking the disk offline via Disk Management, disabling the Microsoft iSCSI Initiator in Device Manager (which needs a reboot), turning off the service in FreeNAS, and even clearing favorite targets and portals in the iSCSI settings. The device isn't active in Windows, so it doesn’t appear to have a file system and can’t be held open by the OS. Ideally, I’d like to disconnect on demand or at least force a clean exit so another machine can connect and then reconnect later. Any suggestions would be greatly appreciated!

Hardware specifics:
- Windows 10 Pro (desktop): Ryzen 5 1600X, 16GB RAM, NVMe boot drive, Mellanox ConnectX-2 (direct link to server)
- FreeNAS Server: Core i3-4170, 32GB RAM, 4×10TB RAIDZ2, Mellanox ConnectX-2 (direct link to desktop)

_
_ByWeed
Junior Member
16
08-12-2017, 03:19 PM
#2
Turning the computer on and off again should allow you to click disconnect, which usually works. I’ve experienced this problem before. While iSCSI might seem useful, it offers little advantage unless you have a particular need—such as a program that relies only on local disks or a system that manages drives remotely. For broader functionality like ZFS or remote management, SMB is likely a better choice. You may want to configure this PC as a network drive so it appears with a letter, making it easier to access.
_
_ByWeed
08-12-2017, 03:19 PM #2

Turning the computer on and off again should allow you to click disconnect, which usually works. I’ve experienced this problem before. While iSCSI might seem useful, it offers little advantage unless you have a particular need—such as a program that relies only on local disks or a system that manages drives remotely. For broader functionality like ZFS or remote management, SMB is likely a better choice. You may want to configure this PC as a network drive so it appears with a letter, making it easier to access.

S
sugarisallmine
Junior Member
14
08-14-2017, 04:07 AM
#3
I recently encountered a similar problem on Server 2019, and using Windows 10 turned out to be ineffective. I opened the Task Manager to check disk I/O, and after closing it, the iSCSI initiator disconnected as expected.
S
sugarisallmine
08-14-2017, 04:07 AM #3

I recently encountered a similar problem on Server 2019, and using Windows 10 turned out to be ineffective. I opened the Task Manager to check disk I/O, and after closing it, the iSCSI initiator disconnected as expected.

Z
Zoomimama
Junior Member
3
08-14-2017, 04:31 AM
#4
I recognize this as an older discussion, but I've encountered this issue repeatedly across different Windows Server environments. It seemed natural to revisit it after seeing a relevant article. Most of the time, I keep Task Manager active, and closing it resolved the problem for me too. That said, I’d like to add more detail: simply shutting down Task Manager fixed it, but the core issue remains. The real cause lies in having Task Manager running with disk performance counters turned on. By default, these are disabled on Windows Server versions 2012/2012 R2/2016/2019. To fix this, you can enable them by launching Command Prompt or PowerShell as an administrator and running `diskperf -Y` or `diskperf -N`. These commands also hide the metrics from Task Manager, but I no longer see the warning about logging out due to device usage. Disconnecting an iSCSI volume is still recommended before doing so, just in case another process needs access.
Z
Zoomimama
08-14-2017, 04:31 AM #4

I recognize this as an older discussion, but I've encountered this issue repeatedly across different Windows Server environments. It seemed natural to revisit it after seeing a relevant article. Most of the time, I keep Task Manager active, and closing it resolved the problem for me too. That said, I’d like to add more detail: simply shutting down Task Manager fixed it, but the core issue remains. The real cause lies in having Task Manager running with disk performance counters turned on. By default, these are disabled on Windows Server versions 2012/2012 R2/2016/2019. To fix this, you can enable them by launching Command Prompt or PowerShell as an administrator and running `diskperf -Y` or `diskperf -N`. These commands also hide the metrics from Task Manager, but I no longer see the warning about logging out due to device usage. Disconnecting an iSCSI volume is still recommended before doing so, just in case another process needs access.

L
183
08-30-2017, 01:05 AM
#5
The task manager frequently indicates that the disk is being used during safe USB ejection attempts. It was difficult to connect the device, mainly since I only use it for backups.
L
LupusGladiator
08-30-2017, 01:05 AM #5

The task manager frequently indicates that the disk is being used during safe USB ejection attempts. It was difficult to connect the device, mainly since I only use it for backups.