Bug 90174 - Clean up if user pulls pen drive without unmounting
Summary: Clean up if user pulls pen drive without unmounting
Status: RESOLVED NOTOURBUG
Alias: None
Product: udisks
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Martin Pitt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-25 15:30 UTC by Thomas Gläßle
Modified: 2015-06-30 06:57 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Thomas Gläßle 2015-04-25 15:30:21 UTC
Unexpected removal of devices causes stale mount points.

Udisks version: 2.1.5

Steps to reproduce:

 - mount device (label: STICKY)
 - physically remove device without unmounting (accidents happen;)
 - reinsert and mount device

Expected results:

  - device is mounted under /media/STICKY

Actual results:

 - device is mounted under /media/STICKY1 (and higher numbers on subsequent tries)

 - previous mount points get recreated as empty folders if they are not present
   (e.g. if removing them via rmdir /media/* before re-insertion)


This behaviour is not deterministic. Sometimes the mount point is correctly cleaned up and the device can be remounted under the same mount point again.


Failing to clean up after device removal is particularly problematic when a luks partition is disconnected (some of my external drives have loose USB/power connections). In this case the mapper device stays open, and I cannot remount without closing the device as root (cryptsetup luksClose). Should I post this as a separate issue?


For reference, this issue was originally posted on:

https://github.com/coldfix/udiskie/issues/63#issuecomment-95935259


Best regards,
Thomas
Comment 1 Martin Pitt 2015-06-30 06:57:26 UTC
This is fixed in a better/more robust way in systemd now. Stale mounts get cleaned up when the underlying device goes away. So I'm closing this. Thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.