org.freedesktop.UDisks2.Manager

org.freedesktop.UDisks2.Manager — Manager singleton

Methods

CanFormat       (IN  s     type,
                 OUT (bs)  available);
CanResize       (IN  s     type,
                 OUT (bts) available);
CanCheck        (IN  s     type,
                 OUT (bs)  available);
CanRepair       (IN  s     type,
                 OUT (bs)  available);
LoopSetup       (IN  h     fd,
                 IN  a{sv} options,
                 OUT o     resulting_device);
MDRaidCreate    (IN  ao    blocks,
                 IN  s     level,
                 IN  s     name,
                 IN  t     chunk,
                 IN  a{sv} options,
                 OUT o     resulting_array);
EnableModules   (IN  b     enable);
EnableModule    (IN  s     name,
                 IN  b     enable);
GetBlockDevices (IN  a{sv} options,
                 OUT ao    block_objects);
ResolveDevice   (IN  a{sv} devspec,
                 IN  a{sv} options,
                 OUT ao    devices);

Properties

Version                   readable   s
SupportedFilesystems      readable   as
SupportedEncryptionTypes  readable   as
DefaultEncryptionType     readable   s

Description

Interface for top-level manager singleton object located at the object path /org/freedesktop/UDisks2/Manager.

Method Details

The CanFormat() method

CanFormat (IN  s    type,
           OUT (bs) available);

Tests for availability to create the given filesystem. See the "SupportedFilesystems" property for a list of known types. Unknown or unsupported filesystems result in an error.

IN s type:

The filesystem type to be tested for formatting availability.

OUT (bs) available:

Formatting availability and the required binary name if missing (i.e. no error and returns FALSE).

Since 2.7.2


The CanResize() method

CanResize (IN  s     type,
           OUT (bts) available);

Tests for availability to resize the given filesystem. The mode flags indicate if growing and/or shriking resize is available if mounted/unmounted. The mode corresponds to bitwise-OR combined BDFSResizeFlags of the libblockdev FS plugin: BD_FS_OFFLINE_SHRINK = 2, shrinking resize allowed when unmounted BD_FS_OFFLINE_GROW = 4, growing resize allowed when unmounted BD_FS_ONLINE_SHRINK = 8, shrinking resize allowed when mounted BD_FS_ONLINE_GROW = 16, growing resize allowed when mounted Unknown filesystems or filesystems which do not support resizing result in errors.

IN s type:

The filesystem type to be tested for resize availability.

OUT (bts) available:

Resizing availability, flags for allowed resizing (i.e. growing/shrinking support for online/offline) and the required binary name if missing (i.e. no error and returns FALSE).

Since 2.7.2


The CanCheck() method

CanCheck (IN  s    type,
          OUT (bs) available);

Tests for availability to check the given filesystem. Unsupported filesystems or filesystems which do not support checking result in errors.

IN s type:

The filesystem type to be tested for consistency check availability.

OUT (bs) available:

Checking availability and the required binary name if missing (i.e. no error and returns FALSE).

Since 2.7.2


The CanRepair() method

CanRepair (IN  s    type,
           OUT (bs) available);

Tests for availability repair the given filesystem. Unsupported filesystems or filesystems which do not support repairing result in errors.

IN s type:

The filesystem type to be tested for repair availability.

OUT (bs) available:

Repair availability and the required binary name if missing (i.e. no error and returns FALSE).

Since 2.7.2


The LoopSetup() method

LoopSetup (IN  h     fd,
           IN  a{sv} options,
           OUT o     resulting_device);

Creates a block device for the file represented by fd.

IN h fd:

An index for the file descriptor to use.

IN a{sv} options:

Options - known options (in addition to standard options) includes offset (of type 't'), size (of type 't'), read-only (of type 'b'), no-part-scan (of type 'b') and sector-size (of type 't').

OUT o resulting_device:

An object path to the object implementing the org.freedesktop.UDisks2.Block interface.


The MDRaidCreate() method

MDRaidCreate (IN  ao    blocks,
              IN  s     level,
              IN  s     name,
              IN  t     chunk,
              IN  a{sv} options,
              OUT o     resulting_array);

Creates a new RAID array on the block devices specified by blocks. Each element in this array must be an object path to an object implementing the org.freedesktop.UDisks2.Block interface.

Known and supported values for level include raid0, raid1, raid4, raid5, raid6 and raid10.

Before the array is created, all devices in blocks are erased. Once created (but before the method returns), the RAID array will be erased.

The bitmap option specifies the write-intent bitmap type, currently only 'none' and 'internal' values are supported. When this option is not present, it is up to mdadm to decide whether to create an internal bitmap (typically for arrays larger than 100 GB) or not.

The version option specifies the MD metadata version, for example '0.90'. If not specified the default medata version specified by mdadm is used. (since 2.11)

IN ao blocks:

An array of object paths to objects implementing the org.freedesktop.UDisks2.Block interface.

IN s level:

The RAID level for the array.

IN s name:

The name for the array.

IN t chunk:

The chunk size (in bytes) or 0 if level is raid1.

IN a{sv} options:

Options - known options (in addition to standard options) include bitmap (of type 'ay') and version (of type 'ay').

OUT o resulting_array:

An object path to the object implementing the org.freedesktop.UDisks2.MDRaid interface.

Since 2.0.0


The EnableModules() method

EnableModules (IN  b enable);

Loads and activates modules. Modules that have been already loaded are not reinitialized on subsequent calls to this method and are skipped. In case any new module is getting activated by this method call a add uevent is triggered on all exported objects.

This takes in account an optional explicit list of modules to load as specified in the /etc/udisks2/udisks2.conf config file. If unspecified all available modules will be loaded.

Modules cannot be deactivated at the moment. This method call never fails even if no module has been activated and by nature it cannot report any particular module initialization failures. Clients have no way of finding that a particular module is available.

This method is deprecated since 2.9.0. Use EnableModule() instead.

IN b enable:

A boolean value indicating whether modules should be enabled. Currently only the TRUE value is permitted.

The EnableModules() method is deprecated.


The EnableModule() method

EnableModule (IN  s name,
              IN  b enable);

Loads and activates single module identified by name. In case the module is already active no reinitialization is done and this call has no effect. Clients are supposed to call this method before using any of the particular module API. In case no such module is available or its initialization fails a proper error is returned. This action also causes all objects to receive add uevent that allows the module to attach extra interfaces before this method call returns.

Modules cannot be deactivated at the moment.

IN s name:

Name of the module.

IN b enable:

A boolean value indicating whether modules should be enabled. Currently only the TRUE value is permitted.

Since 2.9.0


The GetBlockDevices() method

GetBlockDevices (IN  a{sv} options,
                 OUT ao    block_objects);

Get list of all block devices (object paths of objects implementing the org.freedesktop.UDisks2.Block interface) known to UDisks.

IN a{sv} options:

Options (currently unused except for standard options).

OUT ao block_objects:

Since 2.7.2


The ResolveDevice() method

ResolveDevice (IN  a{sv} devspec,
               IN  a{sv} options,
               OUT ao    devices);

Get device(s) matching specification given in devspec.

Currently supported keys for devspec include:

path (type 's')

Device path (e.g. /dev/sda). This also includes symlinks in /dev (both "Device" and "Symlinks" are used).

label (type 's')

Filesystem label. "IdLabel" is used.

uuid (type 's')

Filesystem UUID. "IdUUID" is used.

partuuid (type 's')

Partition UUID. "UUID" is used.

partlabel (type 's')

Partition Name. "Name" is used.

It is possible to specify multiple keys. In this case, only devices matching all values will be returned.

IN a{sv} devspec:

Dictionary with specification of a device.

IN a{sv} options:

Options (currently unused except for standard options).

OUT ao devices:

List of object paths of all devices matching devspec.

Since 2.7.3

Property Details

The "Version" property

Version  readable   s

The version of the daemon currently running


The "SupportedFilesystems" property

SupportedFilesystems  readable   as

List of filesystems supported by UDisks2. For each such filesystem UDisks supports filesystem creation (mkfs) and changing labels.

While UDisks2 can essentially mount any filesystem, only the listed types are fully supported for block operations.


The "SupportedEncryptionTypes" property

SupportedEncryptionTypes  readable   as

List of supported block encryption types by UDisks2.

Since 2.8.3


The "DefaultEncryptionType" property

DefaultEncryptionType  readable   s

The default block encryption type.

Since 2.8.3