-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use BindsTo dependency for mounting Removable storage devices (i.e USB) #1359
Use BindsTo dependency for mounting Removable storage devices (i.e USB) #1359
Comments
Now that i think about it, since this is on a filesytem case, I think udisks should just have I've set x-systemd.device-bound for btrfs in my |
Btrfs has an issue where mount can linger after a sudden device disconnect, this is very apparent with USB storage. the psuedo mount option x-systemd.device-bound overrides the default `Requires` dependency to that of `BindsTo` which will automatically stop the mount if the device became inactive. Partly fixes storaged-project#1359 Please list more filesystems susceptible to lingering mounts in storaged-project#1359 so they can be covered as well.
systemd/systemd#36634 (comment) Oh perhaps udisks could use |
Cleaning up lingering mounts after its backing block device disappears is done in the |
Description
Currently mount units has a
Requires
dependency against the block device or backing file specified underWhat
. This is not desirable for usecases where backing file or block device can be easily detached, which may cause lingering mounts on some filesystems (i.e BTRFS). Examples are USB storage, NBDs, and loop devices.I have seen this myself because I use BTRFS for my USB drive, where accidental detaching causes a lingering mount.
Stuff outside of fstab are given ephemeral mount units and as I am aware has no way to set a BindsTo directive other than mounting via
systemd-mount
. Or by adding mount unit overrides.For stuff in fstab you can use
x-systemd.device-bound
in the mount option.Desired Outcome
For udisks to mount usb devices with a BindsTo relationship against the block device.
Note on Lingering Mounts
Not all filesystems are susceptible to lingering mounts
filesytems susceptible to lingering mounts (mounted, but block device is disconnected)
I believe there are more, but those are just the ones I know.
Related
systemd/systemd#36634
https://www.freedesktop.org/software/systemd/man/latest/systemd.mount.html
https://www.freedesktop.org/software/systemd/man/latest/systemd-mount.html
The text was updated successfully, but these errors were encountered: