- add a org.freedesktop.UDisks.Device.FilesystemRemount(in 'as' options) method to the dbus interface
- add --remount and --remount-options command-line options to udisks, where the argument to --remount can be either a device file path or a mount point (like --unmount)
- remount would require the requester have permissions to both mount and unmount the device
Alternatively, the interface could act like mount and just special-case the remount option for the FilesystemMount method and udisks --mount option, but I don't think that would be as clean.
I can produce a patch for this if the udisks maintainers deem this a valuable enough feature to include.
Rationale for remount vs. unmount/mount:
- you get to keep your current mount options
- faster than unmounting/remounting for both the user and the system
- ensures you stay with the same mountpoint
- convenience of being able to specify either the device file or the mount point
- Downloading photos from flash media: to minimize the window during which corruption could take place, it would be nice to mount the media read-only during transfer. This is at odds with the default behavior of Gnomes volume manager, which mounts rw. Having a scriptable mechanism that doesn't require sudo would streamline this sequence: remount-ro, copy data off, remount-rw, update a tracking file of which images have been transfered, unmount.
- Mounting flash media sync, but switching to async for writing large amounts of data.
Reference - remount support in hal:
Created attachment 119695 [details] [review]
[Patch 1/3] Extend the DBUS interface by MountOptions property
Created attachment 119696 [details] [review]
[Patch 2/3] Add support for remount option
Created attachment 119698 [details] [review]
[Patch 3/3] Handle MountOptions property as path-options-pairs
I've added support for the "-o remount" remount option and extended the DBUS interface by "MountOptions" property.
[Patch 0001] extends the DBUS interface by the MountOptions property, which
holds the mounts options corresponding to the MountPoints property.
It also allows an application to be notified by DBUS PropertiesChanged signal
when the mount options of an mounted FS have changed (e.g. FS remounted
[Patch 0002] adds support for the mount -o remount option allowing to remount a
already mounted FS via DBUS (and udisksctl).
[Patch 0003] changes type of MountOptions property to path-options-pairs.
Please consider those changes for inclusion into next version.