How to Safely Remove USB Mass Storage Device

When you click on the “Safely Remove Hardware” icon in the system tray to remove your USB thumbdrive, you may receive an error message saying that it is still in use and you may not be able to remove it successfully.

Do the following error messages look familiar to you?

Windows can't stop your 'generic deivice' because it is in use. Close any programs or windows that might be using the device, and then try again

The device is currently in use. Close any programs or windows that might be using the device, and then try again

The above errors are reported if there are processes with file handles opened on the USB drive. To safely remove the drives, you will need to determine the offending processes and terminate them.

To resolve this :

  1. Download a copy of Process Explorer from the Microsoft TechNet website. Once downloaded, extract the executable from the ZIP archive and run it.
  2. Press ‘Ctrl-F’ or goto the Find menu and click on the ‘Find Handle or DLL’ option.
  3. Type the drive letter of the USB device in the textbox and click on the ‘Search’ button.
  4. Take note of the process name and it’s PID. Look at the screenshot below for an example. process explorer search
  5. From the main process tree view, click on the PID header to sort the entries based on the process ID and search for the offending process.
  6. Right-click on the process and kill the process. process explorer kill process

You should now be able to safely remove your USB drive. If you are still facing problems with the USB drive, a restart of you computer may be required.

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, php, python, java, javascript, nodejs, react); plays_on(xbox, ps4); linux_desktop_user(true); }