QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
541 stars 48 forks source link

Unable to Detach/Unmount Block Devices using GUI #6054

Open zellchristensen opened 4 years ago

zellchristensen commented 4 years ago

Qubes OS version 4.0.3

Affected component(s) or functionality Device Manager

Brief summary Certain Block Devices persist in the device manager list and can't be detached/unmounted via GUI.

To Reproduce Two separate methods. Example 1 1.) Make sure Windows Tools are installed sudo qubes-dom0-update qubes-windows-tools 2.) Start new or existing VM with Windows Tools attached. qvm-start <vmName> --install-windows-tools 3.) Observe that Qube starts with windows tools attached. 4.) Shutdown Qube. 5.) Optionally, repeat steps with other Qubes or same Qube to get multiple block devices of the Windows Tools for each time it was used.

OR

Example 2 1.) Load an ISO file on to a USB stick 2.) Insert in to Qubes machine, start USB Qube (sys-usb), assign device to OtherVM (Debian based in my test case). 3.) Mount Block Device in OtherVM and verify it's accessible. ( udisksctl mount -b /dev/xvdi in my test case) 4.) In ThirdVM Settings >> Advanced tab, click button "Boot qube from CDROM" 5.) In popup, select from file in qube and select the OtherVM the device is mounted in and browse to the mounted dir and choose the ISO file. Click OK. 6.) ThirdVM starts up with ISO mounted and new Block Device for that ISO. 7.) Shutdown ThirdVM and verify the device is still in the Device Manager, now unattached. 8.) Attempt to unmount from OtherVM ( sudo umount /mnt/removable in my case) 9.) See error, "target is busy"

Expected behavior There should be some way to easily manually remove these Block Devices.

Actual behavior Block devices from dom0 (First example above) remain until system reboot. Block devices from OtherVM's (Second example above) cannot be unmounted from within the VM and are only removed from the Device Manager when that VM is shutdown.

Screenshots snapshot_2020-09-14 Note that USB drive was physically removed before image was taken.

Additional context The screenshot is mostly relating to Example 1 after using the command line to start various VMs with the Windows Tools added leading to multiple versions of the ISO being mounted when no VM is using it. Also Example 2 with the top ISO which cannot be unmounted from inside that debianQube, It just requires the VM be shut down.
I did not try Example 2 with a Fedora based VM yet. I'm using a Debian based VM as my USB drive is formatted in exFat and Fedora lacks exFat support and cannot mount it.

Solutions you've tried Restarting VMs block devices are from or restarting the entire system.

Relevant documentation you've consulted https://www.qubes-os.org/doc/block-devices/ https://www.qubes-os.org/doc/usb-devices/ https://www.qubes-os.org/doc/windows-tools/

marmarta commented 4 years ago

@marmarek , is this not another edition of our favorite "ghost devices" problem?

marmarta commented 4 years ago

So, problem #1 is not qui-tools related: qvm-start does not do it's own cleanup, as it should.

marmarta commented 4 years ago

Okay, and problem #2 is actually the same problem! Which is good, and also I'm assigning this to @marmarek who just said he knows how to fix it :)

github-actions[bot] commented 1 year ago

This issue is being closed because:

If anyone believes that this issue should be reopened and reassigned to an active milestone, please leave a brief comment. (For example, if a bug still affects Qubes OS 4.1, then the comment "Affects 4.1" will suffice.)

marmarta commented 1 year ago

this persists in at least 4.1, probably also 4.2?

ghost commented 1 year ago

this persists in at least 4.1, probably also 4.2?

I hadn't had the exact issue, probably since I haven't used QWT.

A similar issue I came across though, when trying to manually eject a usb device in sys-usb, it persists to stay connected. Only something like echo 1 > /sys/bus/usb/devices/DEVICE/poweroff would keep it from staying connected, whereas eject /dev/DEVICE shows no error but wouldn't work.