9

I just got myself an ORICO M.2 NVMe SSD Enclosure USB-C Adapter and put an unused NVMe 1.3 into it (512GB). When I tried to eject it in the file explorer, there was no eject option, though the format option was there.

File explorer doesn't show eject option

Checking the tray, I did find it, but when I pressed eject, I got that it is still in use:

Eject showing in tray

Couldn't eject

Even after restarting the computer this still was the case. Not understanding why, I checked What's using this file?, which didn't show a thing as using it. So I went on to check the task manager, which oddly enough showed that there was some activity going on, even though this is an empty drive (just formatted it).

After the reboot, I also noticed that the drive now has a "$RECYCLE.BIN" folder. Does this mean that Windows thinks this is an internal drive? If so, does anyone know how I can use this as an independent drive to move between computers?

As a side note, I can read and write data, even getting GB/s rates. enter image description here

Tim Jager
  • 200
  • 1
  • 6

3 Answers3

16

There is likely nothing wrong with that SSD, nor is there any problem with the way Windows has mounted it.

  • Windows OS normally mounts small USB drives, e.g., flash "thumb" drive, without write caching to allow for quick ejection.
  • Large HDD and SSD drives, whether internal or external, are normally mounted with write caching, which speeds up writing to disk by buffering writes in RAM until they are completed. The disadvantage is that one must wait for all writing to complete before removing the drive, and for that reason, an eject button may not be displayed.

Change write caching

If you want to dismount the drive frequently, and you don't mind slowing write access, you can change the drive mount to remove caching.

  • In Explorer, right-click on the drive and select Properties.
  • On the Hardware tab, select Properties (again).
  • Click the Change settings button.
  • On the Policies tab, remove the check from *Enable write caching on the device". The SSD should now be able to be ejected as would a flash drive.

On the other hand, one can use a third-party tool to safely eject even a drive mounted with write caching. Free HotSwap! and many alternatives can be used, and I find them more reliable.

As for the $RECYCLE.BIN file, yes, this is normal, since it allows for temporary "deletion" of files by moving them to the Recycle Bin. That is usually an advantage of having a large external HDD, but if you don't want to use it, you can set the policy for that drive to "Do not move deleted files to the Recycle Bin".

  • Right-click the Recycle Bin.
  • Select the drive letter for the external SSD.
  • Select "Don't move files to the Recycle Bin..."
Glorfindel
  • 4,089
  • 8
  • 24
  • 37
DrMoishe Pippik
  • 25,661
  • 4
  • 36
  • 54
  • 12
    They couldn't manage to make the eject function flush the cache and *then* unmount? – hobbs Apr 18 '23 at 15:35
  • 5
    Am I blind or does your first link actually not say anything about the eject button not being shown when write caching is enabled? If that was actually the case, it would make one question the sanity of the people at Microsoft: why show an "eject" option when it basically does nothing (caching disabled, thus nothing to flush) yet not show it when it is absolutely crucial (caching enabled, thus tons of data in memory which has to be flushed out to preserve FS consistency and prevent data loss)? – TooTea Apr 18 '23 at 16:44
  • @TooTea, you may have missed: "If you can't find the Safely Remove Hardware icon...", where "icon" implies "button". – DrMoishe Pippik Apr 18 '23 at 16:56
  • 3
    But that doesn't have anything to do with write caching, does it? It's just the ordinary behaviour of the system tray hiding icons it doesn't consider too relevant. – TooTea Apr 18 '23 at 17:10
  • 1
    Thank you for your reply! I just tried again with it enabled, and then with it disabled, and it doesn't show an eject option either way in the file explorer... the eject button in the system tray also still says that the drive is in use, also after restarting the computer. – Tim Jager Apr 18 '23 at 19:07
  • 1
    Make sure that "Windows ReadyBoost", SuperFetch, etc haven't decided to use the drive. It likes to choose an SSD. – Ben Voigt Apr 18 '23 at 20:13
  • @BenVoigt, Ready Boost is less likely, because it has to be set by user (and is now considered deprecated). Another possibility is Search Indexer and MS Defender would keep it in use, if there is data on the disk. – DrMoishe Pippik Apr 18 '23 at 20:20
  • 1
    I have in the past sometimes had to do a new low-level format (*not* "quick format") to get write caching turned off for an HD in an Orico enclosure. It has been an option in the format process, if you click on the correct tab. Note: since it's Windoze, there's no good way to know when an option may appear or disappear in different versions, or different circumstances. – Jeffiekins Apr 18 '23 at 21:44
  • The HotSwap!'s purpose is to give eSATA drives similar eject button that already exists for USB drives. I doubt it helps with USB. – ojs Apr 19 '23 at 08:08
  • 6
    This is simply incorrect - you can *absolutely* have a write cached external drive that will show an eject button (and also wait for the cache to be flushed). Whether a device appears as ejectable depends simply on [what the device driver tells the OS](https://devblogs.microsoft.com/oldnewthing/20190626-00/?p=102620). – Voo Apr 19 '23 at 08:32
  • On the other hand if you turn off write-caching, you can simply unplug the device without going through the motions, so it is a solution to the problem. – Voo Apr 19 '23 at 08:33
  • You still yoink out the disk under some programs @Voo And windows is really dumb and doesn't tell easily what program is having a open handle left onto a file @ hobbs even though it knows that. external tools can show the culprit that needs to be closed down – masterX244 Apr 19 '23 at 11:41
  • @master Sure, but if you use a program that uses that disk, you probably shouldn't trust that clicking the eject button is enough either. After all the program might not have an open file handle but simply try to save the file on close, move a temp file or who knows what. – Voo Apr 19 '23 at 21:20
  • Most programs keep their handle open though to prevent that. Notepad++ is a exception (but they know of the issue and got a fallback to avoid data loss, they keep the content safe and ask if you want to keep it open once the original file disappears, thy also keep any "unsaved" changes in the appdata-folder in backup files so it even survives closing/reopen of N++) – masterX244 Apr 20 '23 at 09:10
  • "Most programs keep their handle open" is complete nonsense. I don't even understand the singularity of "handle open".. ***most apps*** that require persistence open a handle to a file, write, and close the file. If someone on my team attempted to check in code that didn't close it's handle immediately after serializing, I would deny the code review as would all of my colleagues. – Señor CMasMas Apr 20 '23 at 14:02
2

This has been an annoyance ever since "safely remove" feature was introduced. From my experience you have two ways to deal with it -

  1. Ignore the warning message and unplug device, as long as you are not interrupting any writing operations to the device. That means closing whatever contents/apps you know might be writing, and turn off write caching in the device Property tab.

  2. Track down all open handles referencing the drive and close them manually (either by closing the app owning the threads or just the threads themselves), before using the "safely remove" feature. This can be done using 3rd party tools that could view file handles of any running threads, e.g. Process Explorer.

Realistically you probably want to do 1. MS at various times told people feel free to unplug usb without using safe removal. And frankly if there's a process that you don't know about is writing something to your flash drive, chances are you don't care about losing whatever it's writing.

You can do 2 if you are really curious what's stopping you from using "safely remove". I've done that a few times out of annoyance and found out some 3rd party app has a habit of claiming territory on newly mounted partitions.

And just to be clear, writing cache policy is not why you can't safely remove. It's all those open file handles that Windows don't feel like closing. It's basically the same as when you want to delete/move a file and Windows tells you it's in use (and often without telling you who's using it)

xiaomy
  • 121
  • 3
  • There is a third option (which most people REALLY don't like). Tell windows to reboot and unplug the device in the middle (upon UEFI settings screen). Windows will not refuse to reboot and will flush the drive on the way out. – Señor CMasMas Apr 20 '23 at 17:14
1

Try a software called "LockHnuter", basically it searches and kills the app which is holding up the SSD.

Also make sure your Windows Defender isn't scanning your drive if it's causing the eject issue.

Nandini
  • 1
  • 8