GP SoftwareTwitter
Opus FAQsManualCommandsObjects

DO11 - Windows 10 - Unable to Eject Western Digital External Drive


#1

Hello

I have Directory Opus 11 running on Windows 10. I have a Western Digital My Book 4TB external drive attached to my computer as drive G:

When I am not reading from or writing to the external drive, and I try to eject the drive, I get a Windows 10 error saying the drive cannot be ejected because it is in use. Even if I close every program I opened including DO I still get the error. I realize there may be memory resident parts of DO still active.

What am I doing wrong, and is there anything I can do such as changing a setting or using a startup parameter that will enable me to eject the drive when not in use?

Thanks for your help

Maurice


#2

Do you see that even after fully exiting Opus (via File / Exit Directory Opus), not just closing all of its windows?

Do you know if the drive is mounted as fixed or removable?


#3

Leo,

Thanks you for your reply.

I do get this error even after exiting from DO.

I think the drive is mounted as a fixed drive because when I use Windows to display the drives, the external drive G is right under drive C as a Hard Disk drive, and it is not listed under devices with removable storage.

Maurice


#4

It can't be Opus locking the drive in that case. (Or, if Opus is locking it, it is not the only thing.)

Mounting it as fixed can cause things to lock it with the assumption it won't be removed. It may also change whether or not drive-ejection events are sent before it is removed, which is what Windows uses to get everything to unlock a drive prior to removal.

Whether it is that and whether you have a choice in mounting it a different way will depend on the drive and other software on your system. Asking the drive manufacturer for advice is probably the best thing to do. Failing that, a forum like Superuser may have suggestions. Windows does support hot swap drives but it can depend on the storage driver for them allowing it.


#5

Leo,

Thanks again for your advice. I will try Western Digital. I did not have this problem under Windows 7 so Windows 10 can be involved too.

Maurice


#6

@MauriceFrank,

I've had the same problem and I think it's a Windows issue. I think it may be related to Microsoft Malware Protection Command Line Utility or maybe Microsoft Search Filter host. You can try running handle (command line) or Process Explorer (GUI) to see exactly which file is open.

Unfortunately, I've found under Windows 10 that even when no process found via Process Explorer a file on my removable drive open, sometimes I'm still unable to eject the drive due to it still being "in use"... You can download them from Microsoft for free:

Download Process Explorer.
Download Handle.

Best of Luck,


#7

@ouwen,

Thanks for the reply. I have Process Explorer and it showed me that dopus.exe was holding onto G:, the drive letter of my external drive. That's why I asked for tips in this forum in case there is a setting I could change.

Based on a previous reply, seeing the drive is configured as a fixed not a removable drive might also be part of the problem. I agree Windows is involved, as far as I can tell.

Maurice


#8

What happens when you use Process Explorer when Opus has been fully exited?


#9

Leo,

After I do File Exit in DO, and I use Find G: in Process Explorer, nothing is found, but I still get the device in use error.

I will post a question in the Western Digital forum in case there are any lessons learned there.

At this point this has become a curiosity for me. I can live with not being able to disconnect the drive without shutting down. I just want to understand what's happening.

Thanks for your help

Maurice


#10

@mauricefrank

I have various WD external drives. Sometimes a drive cannot be 'disconnected' (in use-error).

Am using below script, with thanks to Diego Queiroz which is using diskpart to get the disk offline.
give it a name, like DeleteUSBDrives.bat or so, rightclick, run as admin.
It works fine with me.

=

[code]rem Just run the .bat script as administrator, select the volume, and press ENTER.
rem After it you should be able to use "Safe remove" as usual to detach the unit.
rem This script is based on @Rook suggestion, so it uses diskpart to make the disk offline.
rem When this is done, all handles are forcibly closed.
rem The difference in this script is that it automatically make the disk back online,
rem so it can be recognized the next time it is connected to the system.
rem http://superuser.com/questions/420168/safely-remove-external-usb-drive-fails-due-to-extend/674255#674255
rem

@echo off
@cls

set tempfile="%TEMP%\diskscrp.dsk"

echo.
echo === Disk removal tool ===
echo.
echo Select the disk volume number
echo (if the disk has multiple volumes, select any of them)
echo.
echo list volume | diskpart | findstr /C:Volume /C:---
echo.
set /p volume=" Selected volume: "
echo.

echo select volume %volume% >>%tempfile%
echo offline disk >>%tempfile%
echo online disk >>%tempfile%

diskpart /s %tempfile% | findstr /C:"not valid"

if "%ERRORLEVEL%"=="1" (
echo Disk has been unlocked successfully. Try to safely remove it now.
)

del /F %tempfile%

wait
echo any key to exit[/code]


#11

@opw62

Thanks for the script. I will try this tonight when I am home

maurice


#12

The below may get you a little bit of an idea.

Pls do remember, after 'disconnecting' the drive goes online again, but then the 'eject' will work.
well, at least, with me, it never failed.

Note: I always do a File->Exit on all applications, before disconnecting/ejecting a drive,
so the number of applications that might interfere is limited to a minimum.

Good luck!

=

select the drive, be sure to take the right number of course.. :slight_smile:

drive goes online again, but can be disconnected (eject) safely then...


#13

@opw61,

Thanks! The batch file you provided worked and I was able to eject the drive.

I appreciate you help and wish you well.

Maurice


#14

@MauriceFrank

Thanks for the feedback.
Good to hear.
This script never let me down.

=