maharmstone / btrfs

WinBtrfs - an open-source btrfs driver for Windows
GNU Lesser General Public License v3.0
5.84k stars 226 forks source link

USB drive unable to safely remove on Windows #321

Open JSchoeck opened 3 years ago

JSchoeck commented 3 years ago

With a newly installed BTRFS 1.7.5 driver on current Windows 10, I have the problem that I cannot remove the USB drive via Windows' "safely remove drive" function in the task bar. The error message is (translated from German): "The device 'Volume' cannot be stopped, because a program is accessing it. Close all programs which might use the device and repeat the process." - titled "Error when unmounting 'USB-connected SCSI (UAS)-..."

I am not using any programs that access the device. I only checked out the content of some folders, not even opening a file - and even closing the Explorer window didn't allow me to remove the drive. This has happened every time I tried over the last days.

As far as I know there is also no other way to remove / unmount a drive in Windows, also no in the btrfs properties of the mounted volume.

maharmstone commented 3 years ago

Thanks. I suspect this is the same issue as https://github.com/maharmstone/btrfs/issues/297, namely something is grabbing the drive and not letting go.

If you log out and log back in again, will it let you unmount then?

resadent commented 3 years ago

I can confirm I can't umount the device even after loging out and back in again.

Hiltronix commented 3 years ago

Hello,

I'm having the same issue with Windows 7 64, with WinBtrfs v1.7.6. Not able to eject external drive using taskbar drive eject feature.

Problem Ejecting USB Mass Storage Device Windows can't stop your 'Generic volume' device because a program is still using it. Close any programs that might be using the device, and then try again later.

This even happens right after Windows startup, and not opening any apps or an Explorer window. I'm not able to eject drive cleanly.

jonau01 commented 3 years ago

Same issue with btrfs-1.7.8.1 on Windows 10 20H2.

IlluminatiWave commented 3 years ago

Same error, any btrfs drive trying to disconnect, freezes the system

WinBtrfs 1.7.8.1 (Installed with Chocolatey)


Windows 11 Enterprise Version 21H2 OS Build 22000.176 Windows Features Experience Pack 1000.22000.176.0

techno156 commented 2 years ago

It could be a Windows issue. It seems similar to problems that I encountered when ejecting an NTFS device (where $LogFile, or similar NTFS Metadata handle remains active, and prevents Windows from ejecting the drive)

I managed to eject the BTRFS device by firing up diskpart, selecting and offlining the disk, and then using the safely remove feature, in the same way that I would do with an NTFS device.

Offlining the disk does not appear to keep the drive offline if it is reconnected, so there is also no need to online the drive immediately afterward.


Version: WinBtrfs 1.7.9 (Installed with Chocolatey) Windows 10 Home Edition (x64) 21H1 Secure Boot Enabled

jazir555 commented 2 years ago

Same problem here on the newest version

1n5aN1aC commented 2 years ago

Same for me.

I was able to eject using diskpart for some reason......

EDIT: All changes I made on Windows was rolled back. Steps I did: Connect drive. Copy ~3GB in 30 files onto the drive. Wait about a minute to let things settle. Attempt to safely remove a few times. Then Eject via diskpart. Upon plugging into a Linux system, drive was exactly the same as it was before being plugged into Windows.

Gspin96 commented 1 year ago

I'm getting this issue as well on windows 10. Additionally, unplugging the device that wasn't successfully expelled resulted in BSOD. My first attempt at ejecting via diskpart worked, second attempt resulted in BSOD as soon as the command was entered.

user050126 commented 1 year ago

Perhaps try to check what process holds the resources: https://superuser.com/questions/87364/can-windows-tell-me-what-is-using-my-usb-drive (look for "Native Method" within the thread).

megapro17 commented 9 months ago

It still not possible to eject any drive

Masamune3210 commented 9 months ago

What process does Event Viewer blame for holding the lock preventing the eject?

nanashi89 commented 1 month ago

Did anyone figure anything out?

Masamune3210 commented 1 month ago

Well, if people actually bothered to answer questions, it would help.....

kaivol commented 1 month ago

@Masamune3210 Do you mean this question?

What process does Event Viewer blame for holding the lock preventing the eject?

On my system, I don't get any ID 225 events when trying to eject the BTRFS USB drive from the taskbar. PowerToys File Locksmith only lists explorer.exe using the drive.

Also - not sure if related - I noticed that there is no Eject option when right-clicking the drive in the Explorer.

Masamune3210 commented 1 month ago

So there is no events with words similar to "Windows couldn't stop a device" ?

kaivol commented 1 month ago

Yes, there is no event logged at all