## org.freedesktop.UDisks2.MDRaid

org.freedesktop.UDisks2.MDRaid — Linux Software RAID

## Methods

    Start             (IN  a{sv} options);
    Stop              (IN  a{sv} options);
    RemoveDevice      (IN  o     device,
                       IN  a{sv} options);
    AddDevice         (IN  o     device,
                       IN  a{sv} options);
    SetBitmapLocation (IN  ay    value,
                       IN  a{sv} options);
    RequestSyncAction (IN  s     sync_action,
                       IN  a{sv} options);
    Delete            (IN  a{sv} options);

## Properties

    UUID                readable   s
    Name                readable   s
    Level               readable   s
    NumDevices          readable   u
    Size                readable   t
    SyncAction          readable   s
    SyncCompleted       readable   d
    SyncRate            readable   t
    SyncRemainingTime   readable   t
    Degraded            readable   u
    BitmapLocation      readable   ay
    ChunkSize           readable   t
    ActiveDevices       readable   a(oiasta{sv})
    ChildConfiguration  readable   a(sa{sv})
    Running             readable   b

## Description

Objects implementing this interface represent Linux Software RAID arrays detected on the system. Both running and not-running arrays are represented.

Block devices point to objects implementing this interface, see the "MDRaid" and "MDRaidMember" properties on the org.freedesktop.UDisks2.Block D-Bus interface.

Since 2.0.0

## Method Details

### The Start() method

    Start (IN  a{sv} options);

Starts the RAID array.

If the `option` parameter contains the key `start`-degraded with the value `TRUE`, the array will be started even if some members are missing.

`IN a{sv} `options``: | Options - known options (in addition to standard options) includes `start-degraded` (of type 'b').

Since 2.0.0

### The Stop() method

    Stop (IN  a{sv} options);

Stops the RAID array.

`IN a{sv} `options``: | Options (currently unused except for standard options).

Since 2.0.0

### The RemoveDevice() method

    RemoveDevice (IN  o     device,
                  IN  a{sv} options);

Removes `device` from the array.

For this to work `device` must already be associated with the array, e.g. referenced in the "ActiveDevices" property.

If the `option` parameter contains the key `wipe` with the value `TRUE`, all known filesystem signatures will be erased from the `device` after removal.

`IN o `device``: | An object path to an object implementing the org.freedesktop.UDisks2.Block interface.
`IN a{sv} `options``: | Options - known options (in addition to standard options) includes `wipe` (of type 'b').

Since 2.0.0

### The AddDevice() method

    AddDevice (IN  o     device,
               IN  a{sv} options);

Adds `device` to the array.

`IN o `device``: | An object path to an object implementing the org.freedesktop.UDisks2.Block interface.
`IN a{sv} `options``: | Options (currently unused except for standard options).

Since 2.0.0

### The SetBitmapLocation() method

    SetBitmapLocation (IN  ay    value,
                       IN  a{sv} options);

Sets whether the array has a write-intent bitmap.

`IN ay `value``: | The value for the bitmap, currently only the values 'none' and 'internal' are supported.
`IN a{sv} `options``: | Options (currently unused except for standard options).

Since 2.0.0

### The RequestSyncAction() method

    RequestSyncAction (IN  s     sync_action,
                       IN  a{sv} options);

This method call can be used to trigger and cancel data redundancy checks and repairs. Currently only the values `check`, `repair` and `idle` can be used for `sync_action`.

See also the property "SyncAction".

This method call is similar to writing to the `sync_action` sysfs file, see the `Documentation/admin-guide/md.rst` file shipped with the kernel sources.

`IN s `sync_action``: | The action to request.
`IN a{sv} `options``: | Options (currently unused except for standard options).

Since 2.0.0

### The Delete() method

    Delete (IN  a{sv} options);

Stops the RAID array and destroys all RAID metadata on member devices.

If the option `tear-down` is set to `TRUE`, then the RAID array block device and all its children will be cleaned up before stopping. This cleanup consists of removing entries from /etc/fstab and /etc/crypttab, and locking of encrypted block devices. Entries in /etc/fstab and /etc/crypttab that have been created with the 'track-parents' options to AddConfigurationItem will be removed even if their block device is currently unavailable.

`IN a{sv} `options``: | Options.

Since 2.0.0

## Property Details

### The "UUID" property

    UUID  readable   s

The UUID of the array.

Since 2.0.0

### The "Name" property

    Name  readable   s

The name of the array (TODO: homehost etc).

Since 2.0.0

### The "Level" property

    Level  readable   s

The RAID level.

Known values include `raid0`, `raid1`, `raid4`, `raid5`, `raid6` and `raid10`.

Since 2.0.0

### The "NumDevices" property

    NumDevices  readable   u

Number of devices that are part of the array.

Since 2.0.0

### The "Size" property

    Size  readable   t

The size of the array or 0 if unknown.

This is the usable size, e.g. for a RAID-5 array backed by 4 1TB disks, this will be approximately 3 TB.

Since 2.0.0

### The "SyncAction" property

    SyncAction  readable   s

The current state of the array or empty if the array is not running or if the array does not have any redundancy (e.g. RAID-0 or linear).

Use the RequestSyncAction() method to change this.

This property corresponds to the `sync_action` sysfs file, see the `Documentation/admin-guide/md.rst` file shipped with the kernel sources.

Since 2.0.0

### The "SyncCompleted" property

    SyncCompleted  readable   d

The fraction or sectors completed (always between `0.0` and `1.0`) in the sync operation or 0.0 if no operation is in progress.

This property corresponds to the `sync_completed` sysfs file, see the `Documentation/admin-guide/md.rst` file shipped with the kernel sources.

Since 2.0.0

### The "SyncRate" property

    SyncRate  readable   t

The rate (or speed) at which the sync operation takes place. It is averaged over the last 30 seconds and measured in bytes per second.

If the rate is unknown or no operation is in progress, the value of this property is 0.

This property corresponds to the `sync_speed` sysfs file, see the `Documentation/admin-guide/md.rst` file shipped with the kernel sources.

Since 2.0.0

### The "SyncRemainingTime" property

    SyncRemainingTime  readable   t

The estimated number of micro-seconds until the operation is finished

If the amount of remaining time is unknown or no operation is in progress, the value of this property is 0.

This property is based on the value of the `sync_speed` sysfs file, see the `Documentation/admin-guide/md.rst` file shipped with the kernel sources.

Since 2.0.0

### The "Degraded" property

    Degraded  readable   u

Number of devices by which the array is degraded (0 if not degraded or not running).

This property corresponds to the `degraded` sysfs file, see the `Documentation/admin-guide/md.rst` file shipped with the kernel sources.

Since 2.0.0

### The "BitmapLocation" property

    BitmapLocation  readable   ay

The location of a write-intent bitmap (empty if the array is not running), if any.

If the RAID array does not suppor write-intent bitmaps (for example RAID-0 arrays), this is empty.

This property corresponds to the `bitmap/location` sysfs file, see the `Documentation/admin-guide/md.rst` file shipped with the kernel sources.

Since 2.0.0

### The "ChunkSize" property

    ChunkSize  readable   t

The chunk size (0 if the array is not running or not using striping).

This property corresponds to the `chunk_size` sysfs file, see the `Documentation/admin-guide/md.rst` file shipped with the kernel sources.

Since 2.0.0

### The "ActiveDevices" property

    ActiveDevices  readable   a(oiasta{sv})

This property is an array with block devices that are currently associated with the with the array. It is empty if the array is not running.

Each element of the array is a struct with the following members:

block (type 'o') | The object path for the underlying block device (guaranteed to implement the org.freedesktop.UDisks2.Block interface)
slot (type 'i') | -1 if the device is not currently part of the array (ie. `spare` or `faulty`), otherwise the slot number the device currently fills (between 0 and "NumDevices")
state (type 'as') | The state of the device - known elements include `faulty`, `in_sync`, `write_mostly`, `blocked` and `spare`
num_read_errors (type 't') | An ongoing count of read errors that have been detected on this device but have not caused the device to be evicted from the array
expansion (type 'a{sv}') | Currently unused. Intended for future expansion.

This property correspond to the `/sys/block/mdN/md/dev-*` directories in sysfs and the sysfs files in each directory. See the `Documentation/admin-guide/md.rst` file shipped with the kernel sources.

Since 2.0.0

### The "ChildConfiguration" property

    ChildConfiguration  readable   a(sa{sv})

Configuration items belonging to the

block devices of this array (recursively). This is also valid when the array is stopped and there are no actual block devices for it. It works via the 'track-parents' options of AddConfigurationItem(), which see.

Since 2.0.0

### The "Running" property

    Running  readable   b

Whether or not the array is considered running.

It is an error to call Start on a running array, and Stop on a non-running array, for example.

Since 2.0.0