org.freedesktop.UDisks2.Filesystem

org.freedesktop.UDisks2.Filesystem — Block device containing a mountable filesystem

Methods

SetLabel (IN  ay    label,
          IN  a{sv} options);
Mount    (IN  a{sv} options,
          OUT ay    mount_path);
Unmount  (IN  a{sv} options);

Properties

MountPoints  readable   aay

Description

This interface is used for org.freedesktop.UDisks2.Block devices that contain a mountable filesystem.

Method Details

The SetLabel() method

SetLabel (IN  ay    label,
          IN  a{sv} options);

Sets the filesystem label.

IN ay label:

The label to set.

IN a{sv} options:

Options (currently unused except for standard options).


The Mount() method

Mount (IN  a{sv} options,
       OUT ay    mount_path);

Mount a filesystem on the device.

The directory the device will be mounted in is determined by looking at data related to the device (such the filesystem UUID and label) and will be created automatically. It is returned in mount_path and is normally a sub-directory of /run/media/$USER but note that any path may be returned.

The filesystem should be unmounted using the Unmount() method.

If the device is removed without being unmounted (e.g. the user yanking the device or pulling the media out) or unmounted in a way that bypasses the Unmount() method (e.g. unmounted by the super-user by using the umount(8) command directly), the device will be unmounted (if needed) and the mount point will be cleaned up.

The file system type can be overridden with the fstype option and mount options can be given in options as a comma-separated string and is of the same format as would be passed to the mount(8) command. Note that the mount options are validated - only a small subset per filesystem type is allowed.

If the device in question is referenced in a system-wide configuration file (such as the /etc/fstab file) then the mount(8) command is called directly as the calling user. If the calling user does not have sufficient permissions to mount the device (it could be the user or users option isn't specificed), then additional authorization is requested and, if obtained, the mount(8) command is invoked as root. Additionally, the given options and fstype options are not used as they are instead read from the system-wide configuration file in question.

IN a{sv} options:

Options - known options (in addition to standard options) includes fstype (of type 's') and options (of type 's').

OUT ay mount_path:

The filesystem path where the device was mounted.


The Unmount() method

Unmount (IN  a{sv} options);

Unmount a mounted device.

If the filesystem is busy, this operation fails with the error org.freedesktop.UDisks2.Error.DeviceBusy unless the option force is used.

If the device in question is referenced in a system-wide configuration file (such as the /etc/fstab file) then the umount(8) command is called directly as the calling user. If the calling user does not have sufficient permissions to unmount the device (it could be the user or users option isn't specificed), then additional authorization is requested and, if obtained, the umount(8) command is invoked as root.

IN a{sv} options:

Options - known options (in addition to standard options) includes force (of type 'b').

Property Details

The "MountPoints" property

MountPoints  readable   aay

An array of filesystems paths for where the file system on the device is mounted. If the device is not mounted, this array is empty.