• Safely remove hardware issue

    Author
    Topic
    #2383778

    I’m having an issue with safely remove hardware issue.

    When i have a USB drive plugged in and try and use this feature to safely remove nothing at all happens what so ever and i cannot seem to fix the issue.

    I wonder if anyone here can point me in a direction of a fix.

    Thanks.

    Viewing 9 reply threads
    Author
    Replies
    • #2383795

      Microsoft changed the default three years ago, so it shouldn’t be necessary:

      Change in default removal policy for external storage media in Windows 10, version 1809

      • #2383831

        Unfortunately b it’s still a problem. Sometimes it works and most of the time it doesn’t. I made those changes quite some time ago and over half the time I end up having to shut down the computer to remove the USB device. I usually get a pop up that the drive is in use and that can go on forever.

        Don't take yourself so seriously, no one else does 🙂
        All W10 Pro at 22H2,(2 Desktops, 1 Laptop).

        • #2383841

          I usually get a pop up that the drive is in use

          When you do what?

          Quick removal: This policy manages storage operations in a manner that keeps the device ready to remove at any time. You can remove the device without using the Safely Remove Hardware process.

          • #2383859

            When you do what?

            Try to use Safe Removal on any USB device. I’ve always liked the safe removal because the drive “should” be done before removal.

            Don't take yourself so seriously, no one else does 🙂
            All W10 Pro at 22H2,(2 Desktops, 1 Laptop).

    • #2383839
    • #2383844

      I’ve found this to be a hardware-dependent problem. Hardware as in computer make (and perhaps model?). AND, hardware as the particular USB thumb drive (yes, I’ve switched subjects here). On some computers, no problem; on others, always rejected.

      When a Safely Remove doesn’t work / is rejected – “is currently in use”, try this:
      In Explorer, right-click on the device > Eject.
      You’ll get a warning; click on the “Continue” button. But be sure that YOU are through with the device.

      • #2383860

        When a Safely Remove doesn’t work / is rejected – “is currently in use”, try this: In Explorer, right-click on the device > Eject. You’ll get a warning; click on the “Continue” button. But be sure that YOU are through with the device.

        That doesn’t work either. Same currently in use pop up.

        Don't take yourself so seriously, no one else does 🙂
        All W10 Pro at 22H2,(2 Desktops, 1 Laptop).

        • #2383878

          Can’t give any advice, except to say you’re not alone. I’ve suffered with this irritating little “I’m sorry Dave I can’t let you do that” glitch for years now, across multiple different Windows OS’s (and I’m sure Windows 11 won’t fix it either).  It’s almost certainly Explorer itself that’s got a lock on file that it likes so much that it won’t let go, but nothing I’ve ever tried has fixed the problem

          Sometimes the device will eject happily, but usually it won’t. Sometimes waiting for a while will appease the ejection gods, but usually it won’t. Sometimes closing all open apps will appease the ejection gods, but usually it won’t

          Usually there’s nothing for it except to sigh deeply and close down, and then start over (usually a Power/Restart will work, but sometimes it won’t). Fortunately for me I usually only want to remove the device at the end of the day, when I power off completely anyway (but sometimes I want to remove the device part way through the day. And can’t)

          What’s particularly galling (to me anyway) is the weaselly way it tries to imply that you’re somehow to blame, when you can see quite clearly that you’ve got absolutely nothing open that might be preventing the USB ejection, and that all operations on it ceased some while back

    • #2383875

      This photo was taken on Win 7 on a Lenovo tower.
      Continue

      Plugged same drive into my wife’s Win 10 HP laptop. ‘Safely Remove’ worked as expected.

    • #2383889

      Plugged same drive into my wife’s Win 10 HP laptop. ‘Safely Remove’ worked as expected.

      You can’t compare removal behavior with 2 different PC, not even on the same PC as the removal depends on what was the last app using the USB, what is running in the background…

      Usually disabling / enabling file explorer will release the USB.

    • #2383970

      I had this issue recently with a USB stick that I had only inserted, nothing more. I did not open it with File Explorer but I was shown an error dialog when I tried to safely eject it.

      I ran Process Explorer, filtered on the stick’s drive letter and noted that – even though I had done nothing more than insert the USB stick – there were a lot of related Explorer and SearchIndexer events but nothing that explained the error ejecting it safely.

      usb_eject_problem

      I ran LockHunter  on the USB stick and saw several metadata files open.

      lockhunter_locking_processes

      Unfortunately LockHunter wasn’t successful in unlocking the file locks.

      As a test, I opened the Services snap-in (services.msc) and restarted the Windows Search service (WSearch – the source of the SearchIndexer processes).

      Lo and behold… the file locks disappeared and I was able to eject the USB stick safely without restarting Explorer (which I try to avoid doing because I often have lots of folders open).

      I’m not 100% convinced Windows Search is solely to blame but I’m testing this at the moment. I thought about using a simple BAT file like:

      sc stop "WSearch"
      sc start "WSearch"

      … but there’s a problem of timing. The commands run so quickly that stop hasn’t completed before start fires… so it doesn’t work as a restart.

      PowerShell has the perfect cmdlet – Restart-Service – but displays a console window. The best I could do was create a desktop shortcut using the following ‘target’ property:

      C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden "Restart-Service WSearch"

      This worked yet again – the file locks were removed and I was able to safely eject with no error. Unfortunately there’s still an annoying flash of a PowerShell console.

      I prevailed upon a colleague to compile the PowerShell one-liner (as a developer he has access to tools that I don’t):

      Restart-Service -displayname "Windows Search"

      I ended up with a 291KB executable that should work with Windows Vista upwards with no console flash at all. I was going to add a Message Box but can’t find a way of doing it with a 1 second timeout (and it looks like the minimum code for a MsgBox is ~8-10 lines?).

      I’m going to use the desktop shortcut method to test the next time I get a cannot safely eject error. If it turns out that SearchIndexer IS responsible for the error then I’ll wrap the PowerShell cmdlet in AutoHotkey code so I don’t see the PowerShell console flash but can still have a MsgBox (with timeout… in only one line of code).

      MsgBox, 64, Windows Search, The 'WSearch' service has been restarted, 1
      1 user thanked author for this post.
    • #2384002

      Alex, like Rick, all I’ve done is plug it in, and attempted a Safely Remove.
      Rick, you’ve done some good digging. Following up on it —
      For the Batch file, insert a Pause between the two SC-s. Would require manual input.
      BUT, on Win 7, Search isn’t stoppable.
      StopSrch

      However, does this mean that one can ignore the error message and disconnect?
      QuickRemove
      This is from: Device Manager > Properties > “Change Settings” > Policies.

      • #2384132

        However, does this mean that one can ignore the error message and disconnect?

        Yes.

    • #2384019

      BUT, on Win 7, Search isn’t stoppable.


      @paulk
      – Many thanks. I’ve amended my previous post to ‘that should work with Windows Vista upwards’.

      In the absence of more info, my colleague compiled the executable to be compatible with PowerShell 2.0 upwards. My VM host is currently dead in the water so I wasn’t able to test it with either Windows 7 or Vista, only Windows 10 so far.

      I wasn’t too worried ‘cos SearchIndexer being the cause is still only a hypothesis and I haven’t been able to duplicate the problem on demand. Obviously a lot more testing is required… the next time it occurs.

      There’s also an anomaly that my replacement Task ManagerProcess Hacker – was not able to restart the SearchIndexer service, declaring it needed elevation:

      process_hacker_unable_to_stop_WSearch

      … yet the built-in Services snap-in (services.msc – running from an account in the Administrators group) managed it without complaint… as does the desktop shortcut running in the same user context.

    • #2384118

      Here is an older thread that I was in for this problem dated Sept. 2020 after looking through Event Viewer. A later post by me (in that thread) was when I “Thought” I had found a problem with MalwareBytes locking things up but it proved false.

      https://www.askwoody.com/forums/topic/safe-ejection-of-usb-drives/#post-2293127

      Don't take yourself so seriously, no one else does 🙂
      All W10 Pro at 22H2,(2 Desktops, 1 Laptop).

    • #2385236

      Thanks guys

    Viewing 9 reply threads
    Reply To: Safely remove hardware issue

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: