org.freedesktop.DeviceKit.Disks

org.freedesktop.DeviceKit.Disks — Disks interface

Methods

EnumerateDevices         (out 'ao' devices)
EnumerateDeviceFiles     (out 'as' device_files)
FindDeviceByDeviceFile   (in  's'  device_file,
                          out 'o'  device)
FindDeviceByMajorMinor   (in  'x'  device_major,
                          in  'x'  device_minor,
                          out 'o'  device)
DriveInhibitAllPolling   (in  'as' options,
                          out 's'  cookie)
DriveUninhibitAllPolling (in  's'  cookie)
LinuxMdStart             (in  'ao' components,
                          in  'as' options,
                          out 'o'  device)
Inhibit                  (out 's'  cookie)
Uninhibit                (in  's'  cookie)

Signals

DeviceAdded      ('o' device)
DeviceRemoved    ('o' device)
DeviceChanged    ('o' device)
DeviceJobChanged ('o' device,
                  'b' job-in-progress,
                  'b' job-is-cancellable,
                  's' job-id,
                  'i' job-num-tasks,
                  'i' job-cur-task,
                  's' job-cur-task-id,
                  'd' job-cur-task-percentage)

Implemented Interfaces

Objects implementing org.freedesktop.DeviceKit.Disks also implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties

Properties

'daemon-version'        read      's'
'daemon-is-inhibited'   read      'b'
'supports-luks-devices' read      'b'
'known-filesystems'     read      'a(ssbbbubbbbbbbb)'

Description

Details

EnumerateDevices ()

EnumerateDevices (out 'ao' devices)

Enumerate all disk devices on the system.

devices:

An array of object paths for devices.

EnumerateDeviceFiles ()

EnumerateDeviceFiles (out 'as' device_files)

Enumerate all device files (including symlinks) for disk devices on the system.

device_files:

An array device file names.

FindDeviceByDeviceFile ()

FindDeviceByDeviceFile (in  's' device_file,
                        out 'o' device)

Finds a device by device path.

device_file:

UNIX special device file

device:

Object path of device

FindDeviceByMajorMinor ()

FindDeviceByMajorMinor (in  'x' device_major,
                        in  'x' device_minor,
                        out 'o' device)

Finds a device by major:minor.

device_major:

Device major

device_minor:

Device minor

device:

Object path of device

DriveInhibitAllPolling ()

DriveInhibitAllPolling (in  'as' options,
                        out 's'  cookie)

Inhibits the daemon from polling devices for media changes.

options:

Inhibit options. Currently no options are recognized.

cookie:

A cookie that can be used in the DriveUninhibitAllPolling() method to stop inhibiting polling of all devices.

Errors

org.freedesktop.PolicyKit.Error.NotAuthorized:

if the caller lacks the appropriate PolicyKit authorization

org.freedesktop.DeviceKit.Disks.Error.Failed:

if the operation failed

Permissions

The caller will need one of the following PolicyKit authorizations:

  • org.freedesktop.devicekit.disks.inhibit-polling: To inhibit polling


DriveUninhibitAllPolling ()

DriveUninhibitAllPolling (in  's' cookie)

Uninhibits daemon from polling devices for media changes.

cookie:

A cookie obtained from the DriveInhibitAllPolling() method.

Errors

org.freedesktop.DeviceKit.Disks.Error.Failed:

if the given cookie is malformed

LinuxMdStart ()

LinuxMdStart (in  'ao' components,
              in  'as' options,
              out 'o'  device)

Starts an Linux md RAID array. The array will be assembled and started in degraded mode if an insufficient number of components are given.

components:

The object paths of the components of the array to start.

options:

Options for starting the array. Currently no options are supported.

device:

The object path of the assembled array device.

Errors

org.freedesktop.PolicyKit.Error.NotAuthorized:

if the caller lacks the appropriate PolicyKit authorization

org.freedesktop.DeviceKit.Disks.Error.Busy:

if one of the given components are busy

org.freedesktop.DeviceKit.Disks.Error.Failed:

if the operation failed

org.freedesktop.DeviceKit.Disks.Error.Cancelled:

if the job was cancelled

Permissions

The caller will need the following PolicyKit authorization:

  • org.freedesktop.devicekit.disks.linux-md: Needed to configured Linux md Software RAID devices.


Inhibit ()

Inhibit (out 's' cookie)

Inhibits clients from invoking methods on the daemon of the daemon that require authorization (all methods will return the org.freedesktop.DeviceKit.Disks.Error.Inhibited error) if the caller is not the super user. This is typically used by OS installers and other programs that expects full control of the system, specifically to avoid automounting devices.

cookie:

A cookie that can be used in the Uninhibit() method. to stop inhibiting the daemon.

Errors

org.freedesktop.PolicyKit.Error.NotAuthorized:

if the caller is not the super user

Permissions

Only the super user can invoke this method.


Uninhibit ()

Uninhibit (in  's' cookie)

Uninhibits other clients from using the daemon.

cookie:

A cookie obtained from the Inhibit() method.

Errors

org.freedesktop.DeviceKit.Disks.Error.Failed:

if the given cookie is malformed

Signal Details

The DeviceAdded signal

DeviceAdded ('o' device)

Emitted when a device is added.

device:

Object path of device that was added.

The DeviceRemoved signal

DeviceRemoved ('o' device)

Emitted when a device is removed.

device:

Object path of device that was removed.

The DeviceChanged signal

DeviceChanged ('o' device)

Emitted when a device changed.

device:

Object path of device that was changed.

The DeviceJobChanged signal

DeviceJobChanged ('o' device,
                  'b' job-in-progress,
                  'b' job-is-cancellable,
                  's' job-id,
                  'i' job-num-tasks,
                  'i' job-cur-task,
                  's' job-cur-task-id,
                  'd' job-cur-task-percentage)

Emitted when a job on a device changes.

device:

The object path of the device.

job-in-progress:

Whether a job is currently in progress.

job-is-cancellable:

Whether the job is cancellable.

job-id:

The identifier of the job.

job-num-tasks:

Number of tasks in the job.

job-cur-task:

Current task number (zero-based offset).

job-cur-task-id:

Task identifier for current task.

job-cur-task-percentage:

Percentage completed of current task (between 0 and 100, negative if unknown).

Property Details

The "daemon-version" property

'daemon-version'  read      's'

The version of the running daemon.


The "daemon-is-inhibited" property

'daemon-is-inhibited'  read      'b'

TRUE only if the daemon is inhibited.


The "supports-luks-devices" property

'supports-luks-devices'  read      'b'

TRUE only if the daemon can create encrypted LUKS block devices, see the LuksUnlock() and LuksLock() methods for details.


The "known-filesystems" property

'known-filesystems'  read      'a(ssbbbubbbbbbbb)'

An array of file systems known to the daemon and what features are supported. Each element in the array contains the following members:

  • id: The name / identifier of the file system (such as ext3 or vfat), similar to the contents of the Device:id-type property.
  • name: A human readable name for the file system such as "Linux Ext3".
  • supports_unix_owners: Whether the file system supports the UNIX owners model (e.g. ext3 does, but vfat doesn't).
  • can_mount: Whether the file system can be mounted.
  • can_create: Whether the file system can be created on a device.
  • max_label_len: The maximum amount of bytes that the file system label can hold. Set to zero if the file system doesn't support labels.
  • supports_label_rename: Whether the label of the file system can be changed.
  • supports_online_label_rename: Whether the label can be changed while the file system is mounted.
  • supports_fsck: Whether the file system can be checked.
  • supports_online_fsck: Whether the file system can be checked while mounted.
  • supports_resize_enlarge: Whether the file system can be enlarged.
  • supports_online_resize_enlarge: Whether the file system can be enlarged while mounted.
  • supports_resize_shrink: Whether the file system can be shrunk.
  • supports_online_resize_shrink: Whether the file system can be shrunk while mounted.