-
Notifications
You must be signed in to change notification settings - Fork 159
Open
Description
Steps to reproduce:
- Format a USB flash drive with a LUKS-encrypted BTRFS partition.
- Set the label of both the partition and the LUKS header to "Test (1)".
- Eject and reattach the flash drive.
- Unlock the encrypted device
- Attempt to mount it (multiple times)
Most steps can be done with gnome-disk-utility, except setting the label in the LUKS header, which can be done with cryptsetup config --label=<label> <device>.
After attempting to mount it, udisks2 will report the partition as unmounted. However, mount will show one mount point for each attempt:
/dev/mapper/Test_\x281\x29 on /run/media/<user>/Test (1) type btrfs
/dev/mapper/Test_\x281\x29 on /run/media/<user>/Test (1)1 type btrfs
/dev/mapper/Test_\x281\x29 on /run/media/<user>/Test (1)2 type btrfs
...
Attempting to eject the device or lock the encrypted partition will fail with "Device or resource busy" unless I manually unmount each mount point.
Example with udisksctl once the partition has been prepared:
$ udisksctl unlock -b /dev/sda1
Passphrase:
Unlocked /dev/sda1 as /dev/dm-1.
$ udisksctl mount -b /dev/dm-1
Mounted /dev/dm-1 at /run/media/<user>/Test (1)
$ udisksctl info -b /dev/dm-1
...
org.freedesktop.UDisks2.Filesystem:
MountPoints: (empty)
$ udisksctl unmount -b /dev/dm-1
Error unmounting /dev/dm-1: GDBus.Error:org.freedesktop.UDisks2.Error.NotMounted: Device `/dev/dm-1' is not mounted
$ udisksctl mount -b /dev/dm-1
Mounted /dev/dm-1 at /run/media/<user>/Test (1)1
$ udisksctl mount -b /dev/dm-1
Mounted /dev/dm-1 at /run/media/<user>/Test (1)2
$ udisksctl unmount -b /dev/dm-1
Error unmounting /dev/dm-1: GDBus.Error:org.freedesktop.UDisks2.Error.NotMounted: Device `/dev/dm-1' is not mounted
$ udisksctl lock -b /dev/sda1
Error locking /dev/sda1: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error locking /dev/dm-1 (/dev/sda1): Failed to deactivate device: Device or resource busy
Logs show:
Unlocked device /dev/sda1 as /dev/dm-1
Error statting /dev/mapper/Test_\134x281\134x29: No such file or directory
Cleaning up mount point /run/media/<user>/Test (1) (device 252:1 is not mounted)
Error cleaning up mount point /run/media/<user>/Test (1): Error removing directory: Device or resource busy
Cleaning up mount point /run/media/<user>/Test (1) (device 252:1 is not mounted)
Error cleaning up mount point /run/media/<user>/Test (1): Error removing directory: Device or resource busy
Cleaning up mount point /run/media/<user>/Test (1) (device 252:1 is not mounted)
Error cleaning up mount point /run/media/<user>/Test (1): Error removing directory: Device or resource busy
Error statting /dev/mapper/Test_\134x281\134x29: No such file or directory
Error statting /dev/mapper/Test_\134x281\134x29: No such file or directory
Cleaning up mount point /run/media/<user>/Test (1) (device 252:1 is not mounted)
Error cleaning up mount point /run/media/<user>/Test (1): Error removing directory: Device or resource busy
Cleaning up mount point /run/media/<user>/Test (1)1 (device 252:1 is not mounted)
Error cleaning up mount point /run/media/<user>/Test (1)1: Error removing directory: Device or resource busy
Cleaning up mount point /run/media/<user>/Test (1) (device 252:1 is not mounted)
Error cleaning up mount point /run/media/<user>/Test (1): Error removing directory: Device or resource busy
Cleaning up mount point /run/media/<user>/Test (1)1 (device 252:1 is not mounted)
Error cleaning up mount point /run/media/<user>/Test (1)1: Error removing directory: Device or resource busy
Cleaning up mount point /run/media/<user>/Test (1) (device 252:1 is not mounted)
Error cleaning up mount point /run/media/<user>/Test (1): Error removing directory: Device or resource busy
Cleaning up mount point /run/media/<user>/Test (1)1 (device 252:1 is not mounted)
...
Things get worse if mounting is attempted through KDE Dolphin, which will cause it to indefinitely create mount points.
I am using udisks2 2.10.91 in Fedora 42 (udisks2-2.10.91-1.fc42.x86_64).
Metadata
Metadata
Assignees
Labels
No labels