How to safely remove an external drive?

Page 1 of 3 123 LastLast

  1. Posts : 175
    Windows 10 Version 6.2 (Build 9200) Home, 64bit
       #1

    How to safely remove an external drive?


    I always have problems to safely remove an external drive:


    The Task Manager causing an error message when I try to safely remove an external is closed.

    There is no process shown accessing anything on the external drive:


    What else could I do (besides of shutting down the Notebook) to safely remove the drives?
      My Computer


  2. TV2
    Posts : 2,221
    W10 Pro 22H2
       #2

    I've had some luck with this by going in to the last program that accessed the external drive (usually Windows Explorer) and choosing and opening a file that is on an internal hard drive. This seems to "release" the external drive.

    Beyond that, in most cases if you are sure there is nothing being written to the drive you can just unplug it. The problems tend to happen when a drive is disconnected while a read or write is going on.
    But it is always best to get that "all clear-safe to remove" from Windows if you can.
      My Computers


  3. Posts : 31,680
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #3

    Enter said:
    I always have problems to safely remove an external drive:

    The Task Manager causing an error message when I try to safely remove an external is closed.

    What else could I do (besides of shutting down the Notebook) to safely remove the drives?
    For me it's usually Task Manager that needs to be closed to let me remove an external drive, but you say you've already closed that.

    Try signing out then log back in again. That should close any processes you have running.
      My Computers


  4. Posts : 175
    Windows 10 Version 6.2 (Build 9200) Home, 64bit
    Thread Starter
       #4

    Thank you

    I've had some luck with this by going in to the last program that accessed the external drive (usually Windows Explorer) and choosing and opening a file that is on an internal hard drive. This seems to "release" the external drive.
    I assume, Process Explorer / Hacker or so or "ThisIsMyFile" would have shown such a process, I couldn't find one.

    Beyond that, in most cases if you are sure there is nothing being written to the drive
    May be Win is indexing anything, do not know if it is shown as some process in those programs above.

    you can just unplug it.
    I would think there might be a risk of losing cached data.

    But it is always best to get that "all clear-safe to remove" from Windows if you can.
    Yes, but I each time have problems with it. It mostly takes a long time to safely remove a drive.

    Many thanks again
      My Computer


  5. Posts : 175
    Windows 10 Version 6.2 (Build 9200) Home, 64bit
    Thread Starter
       #5

    Try signing out then log back in again. That should close any processes you have running.
    Does that interrupt downloads? Or other processes? I would try it next time.
      My Computer


  6. gdv
    Posts : 15
    Win7
       #6

    I haven't used ThisIsMyFile (pictured in your screenshot), but I have used the similar Unlocker (by Cedrick 'Nitch' Collomb) and found that it sometimes does not detect open file handles that lock a file or keep an external drive from being released.

    Usually I have better luck with Sysinternals Process Explorer by doing a simple Search/Find (Ctrl+F) for the drive letter of the external drive in question (e.g. "H:\" without the quotes). This should display all open file handles for the drive, with the Process, PID, File Type, and Name for each handle (including file handles not detected by Unlocker). Usually the file handles can be then be removed by closing the relevant file(s) or program(s), thus freeing the external drive for removal. However, I have occasionally found handles not properly released by Windows Explorer (or some other program), and properly releasing the handles might require closing and reopening Explorer or other offending program.

    ...Or, as TV2 already pointed out, if you're sure the file handle is not in use, you can simply unplug the drive.

    ...Or you're sure the file handle is not in use you can use Process Explorer to force the handle(s) to close (click on the handle in the Search window, which will highlight the same handle in the lower pane of Process Explorer; then right-click on the highlighted handle in the lower pane & select 'Close Handle'), thus freeing the external drive for removal. (Process Explorer will caution you about potential system instability if the wrong handles are closed, but that usually isn't an issue in this situation.)

    If you do decide to try Process Explorer and if your external drive is NTFS formatted, Process Explorer may also find a set of 4 handles such as the following (depending on drive letter):
    H:\$Extend\$RmMetadata\$Txf
    H:\$Extend\$RmMetadata\$TxfLog\$TxfLog.blf
    H:\$Extend\$RmMetadata\$TxfLog\$TxfLogContainer00000000000000000001
    H:\$Extend\$RmMetadata\$TxfLog\$TxfLogContainer00000000000000000002

    These are system process handles that cannot be closed simply by closing a file or exiting a program. When I researched this a few years ago, it was difficult to find good information, and I had to sift through several sources (some inaccurate) to make sense out of it. By now, my own recollection also may not be accurate, but IIRC, these 4 handles are involved with the journaling function on NTFS formatted drives (i.e., you won't see them on a typical FAT32 formatted USB flash drive). They remain open even if you close other open programs or files, and AFAIK there is no way to gracefully close them to release the drive.

    (IIRC, there is a way to disable the journaling function on the external NTFS drive, but I don't recall what it is, and my best recollection is that it didn't work when I tried it... ...But I don't completely trust my recollection on this: it may be that I just never got around to trying it... ...Or it might have been a drive letter dependent registry setting that I decided wasn't worth doing until/unless I settled on a permanent drive letter choice for certain external drives... ...Or???)

    The important (and frustrating) point is that (AFAIK) there seems to be no graceful way to close these handles to release an external drive, short of shutting down the computer before removing the drive (...and AFAIK, ThisIsMyFile or Unlocker, or any other similar file unlocker will not even detect these handles, let alone close them.)

    However, if these four ...$Extend\$RmMetadata\$Txf handles are the only open handles for the drive found by Process Explorer, then as long as the drive has not been recently used by anything that might activate the journaling function, the handles can be closed in Process Explorer to free the drive, or you can just go ahead and unplug the drive. My own practice for my NTFS external drives is to verify these 4 are the only open handles found by Process Explorer, then simply leave the drive inactive for several minutes after concluding any active changes to files on the drive, then go ahead and unplug it. Not ideal, but seems to be the only option short of a system shutdown, and in theory (and in my experience) should produce no problems.

    Edit: (...oops! Other posts since I started writing this may make parts of above redundant/irrelevant.)
      My Computer


  7. Posts : 175
    Windows 10 Version 6.2 (Build 9200) Home, 64bit
    Thread Starter
       #7

    Oops, sorry, didn't get a notification e-mail.

    I haven't used ThisIsMyFile (pictured in your screenshot), but I have used the similar Unlocker (by Cedrick 'Nitch' Collomb) and found that it sometimes does not detect open file handles that lock a file or keep an external drive from being released.
    Yes, I have used Unlocker as well, was the same here, hasn't found such processes.

    Usually I have better luck with Sysinternals Process Explorer by doing a simple Search/Find (Ctrl+F) for the drive letter of the external drive in question (e.g. "H:" without the quotes).
    Yes, I do it as well:

    Also with Process Hacker:


    This should display all open file handles for the drive, with the Process, PID, File Type, and Name for each handle (including file handles not detected by Unlocker). Usually the file handles can be then be removed by closing the relevant file(s) or program(s), thus freeing the external drive for removal.
    FreeCommander is closed but there are still shown some P: processes in Process Monitor:


    How could I delete / close them?

    In Process Explorer this is shown:


    Looks somehow risky to close these handles.

    ...Or, as TV2 already pointed out, if you're sure the file handle is not in use, you can simply unplug the drive.
    And what if Windows is just accessing the drive / NTFS system or so?

    If you do decide to try Process Explorer and if your external drive is NTFS formatted, Process Explorer may also find a set of 4 handles such as the following (depending on drive letter):H:\$Extend\$RmMetadata\$TxfH:\$Extend\$RmMetadata\$TxfLog\$TxfLog.blfH:\$Extend\$RmMetadata\ $TxfLog\$TxfLogContainer00000000000000000001H:\$Extend\$RmMetadata\$TxfLog\$TxfLogContainer000000000 00000000002
    Whoops! Yes, NTFS, the handles from the above screenshot.

    These are system process handles that cannot be closed simply by closing a file or exiting a program. When I researched this a few years ago, it was difficult to find good information, and I had to sift through several sources (some inaccurate) to make sense out of it. By now, my own recollection also may not be accurate, but IIRC, these 4 handles are involved with the journaling function on NTFS formatted drives (i.e., you won't see them on a typical FAT32 formatted USB flash drive). They remain open even if you close other open programs or files, and AFAIK there is no way to gracefully close them to release the drive.
    Besides of shutting down the Notebook, very enconvenient.

    ThisIsMyFile or Unlocker, or any other similar file unlocker will not even detect these handles, let alone close them.)
    Yes, they do not show them.

    However, if these four ...$Extend\$RmMetadata\$Txf handles are the only open handles for the drive found by Process Explorer, then as long as the drive has not been recently used by anything that might activate the journaling function, the handles can be closed in Process Explorer to free the drive, or you can just go ahead and unplug the drive.
    But what if Windows scans / rebuilds or whatever that NTFS?

    My own practice for my NTFS external drives is to verify these 4 are the only open handles found by Process Explorer, then simply leave the drive inactive for several minutes after concluding any active changes to files on the drive, then go ahead and unplug it. Not ideal, but seems to be the only option short of a system shutdown, and in theory (and in my experience) should produce no problems.
    Yes, I had often plugged off a drive, though, but...

    Edit: (...oops! Other posts since I started writing this may make parts of above redundant/irrelevant.)
    No, no, very useful information, many thanks.
      My Computer


  8. Posts : 1,097
    Windows 10 Home x64 Version 1809 (OS Build 17763.437)
       #8

    This solved my problems with disconnecting drive(s) Enable or Disable Disk Write Caching in Windows 10

    Might work for you?
      My Computer


  9. Posts : 175
    Windows 10 Version 6.2 (Build 9200) Home, 64bit
    Thread Starter
       #9

    This solved my problems with disconnecting drive(s) Enable or Disable Disk Write Caching in Windows 10Might work for you?
    Many thanks. Unfortunately it doesn't. That option is enabled since a long time because of this reason, but it doesn't help at all.
      My Computer


  10. Posts : 1,097
    Windows 10 Home x64 Version 1809 (OS Build 17763.437)
       #10

    Enter said:
    Many thanks. Unfortunately it doesn't. That option is enabled since a long time because of this reason, but it doesn't help at all.
    Try the "Disable" option. Sorry if I was misleading.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:42.
Find Us




Windows 10 Forums