Top |
org.freedesktop.UDisks2.Filesystemorg.freedesktop.UDisks2.Filesystem — Block device containing a mountable filesystem |
SetLabel (IN s label, IN a{sv} options); SetUUID (IN s uuid, IN a{sv} options); Mount (IN a{sv} options, OUT s mount_path); Unmount (IN a{sv} options); Resize (IN t size, IN a{sv} options); Check (IN a{sv} options, OUT b consistent); Repair (IN a{sv} options, OUT b repaired); TakeOwnership (IN a{sv} options);
This interface is used for org.freedesktop.UDisks2.Block devices that contain a mountable filesystem.
SetLabel (IN s label, IN a{sv} options);
Sets the filesystem label.
|
The label to set. |
|
Options (currently unused except for standard options). |
SetUUID (IN s uuid, IN a{sv} options);
Sets the filesystem UUID value.
|
The UUID to set. |
|
Options (currently unused except for standard options). |
Since 2.10.0
Mount (IN a{sv} options, OUT s mount_path);
Mounts the filesystem.
The directory the filesystem will be mounted in is determined
by looking at data related to the device or filesystem (such
the filesystem UUID and label) and will be created
automatically except if the device the filesystem resides on
is referenced in the /etc/fstab
file, see
below. In either case, the directory the filesystem is mounted
in, is returned in mount_path
on success - it is usually a
sub-directory of /run/media/$USER
but note that
any directory may be returned.
The filesystem type to use can be overridden with the fstype
option and mount options (a comma-separated string) can be
given in options
option. Note that both the mount options and
filesystem types are validated against a (small) whitelist to
avoid unexpected privilege escalation. The filesystem type is
by default determined by the "IdType"
property. The fstype
option doesn't typically need to be
specified, primarily intended as an override in corner cases.
If the as-user
option is set, the
filesystem is mounted on behalf of the specified user instead
of the calling one. This has usually an effect on the returned
mount_path
and it also allows that user to unmount the
filesystem later. This option expects a user name, not a UID.
If the device in question is referenced in the
/etc/fstab
file, the
mount command is called directly (as root)
and the given options or filesystem type given in options
are
ignored.
If x-udisks-auth
is specified as an option
for the device in the /etc/fstab
file,
then the mount command is run as the
calling user, without performing any authorization check
mentioned above. If this fails because of insufficient
permissions, an authorization check is performed (which
typically results in the user having to authenticate as an
administrator). If authorized, the mount
command is then run as root.
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/or the mount point will be cleaned up.
|
Options - known options (in addition to standard options) includes |
|
The filesystem path where the device was mounted. |
Unmount (IN a{sv} options);
Unmount a mounted device.
If the device in question was mounted by the calling user via the Mount() method the filesystem is unmounted without any authorization checks. Otherwise, an authorization check is performed (which typically results in the user having to authenticate as an administrator). If authorized, the filesystem is unmounted.
If the mountpoint was previously created by udisks it is guaranteed it will be removed upon returning from this method call.
If the filesystem is busy, this operation fails with the error
org.freedesktop.UDisks2.Error.DeviceBusy
unless the force
option is used.
|
Options - known options (in addition to standard options) includes |
Resize (IN t size, IN a{sv} options);
Resizes the filesystem.
Shrinking operations need to move data which causes this action to be slow. The filesystem-resize job for the object might expose progress.
|
The target size in bytes, 0 for maximum. |
|
Options (currently unused except for standard options). |
Since 2.7.2
Check (IN a{sv} options, OUT b consistent);
options
: Options (currently unused except for standard options).
consistent
: Whether the filesystem is undamaged.
since
: 2.7.2
Checks the filesystem for consistency avoiding any modifications or repairs.
Mounted or unsupported filesystems will result in an error.
|
|
|
|
Repair (IN a{sv} options, OUT b repaired);
options
: Options (currently unused except for standard options).
repaired
: Whether the filesystem could be successfully repaired.
since
: 2.7.2
Tries to repair the filesystem.
Mounted or unsupported filesystems will result in an error.
|
|
|
|
TakeOwnership (IN a{sv} options);
options
: Options (in addition to standard options) includes recursive
(of type 'b').
since
: 2.7.2
Changes ownership of the filesystem to the UID and GID of the calling user.
Filesystems that don't support ownership result in an error.
|
|
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.
Size readable t
The size of the filesystem. This is the amount of
bytes used on the block device representing an outer filesystem boundary. If this is smaller than org.freedesktop.Udisks2.Block.Size, then the filesystem can be made larger with Resize.
If the size is unknown, the property is zero. Currently limited to xfs and ext filesystems only.
Please note that reading value of this property typically causes some I/O to read the filesystem superblock. Unlike the rest of the properties this one is set to be retrieved on-demand and is not proactively cached by the daemon.