org.freedesktop.UDisks2.LogicalVolume: UDisks Reference Manual

## org.freedesktop.UDisks2.LogicalVolume org.freedesktop.UDisks2.LogicalVolume — A logical volume |

## Methods

    Activate       (IN  a{sv} options,
                    OUT o     result);
    Deactivate     (IN  a{sv} options);
    Delete         (IN  a{sv} options);
    Rename         (IN  s     new_name,
                    IN  a{sv} options,
                    OUT o     result);
    Resize         (IN  t     new_size,
                    IN  a{sv} options);
    Repair         (IN  ao    pvs,
                    IN  a{sv} options);
    CreateSnapshot (IN  s     name,
                    IN  t     size,
                    IN  a{sv} options,
                    OUT o     result);
    CacheAttach    (IN  s     cache_name,
                    IN  a{sv} options);
    CacheSplit     (IN  a{sv} options);
    CacheDetach    (IN  a{sv} options);

## Properties

    VolumeGroup             readable   o
    Name                    readable   s
    Active                  readable   b
    UUID                    readable   s
    Size                    readable   t
    DataAllocatedRatio      readable   d
    MetadataAllocatedRatio  readable   d
    Type                    readable   s
    Layout                  readable   s
    Structure               readable   a{sv}
    SyncRatio               readable   d
    ThinPool                readable   o
    Origin                  readable   o
    ChildConfiguration      readable   a(sa{sv})
    BlockDevice             readable   o

## Description

Objects with this interface represent logical volumes in a volume group. Active logical volumes are associated with a block device, which link back to the logical volume object via their "LogicalVolume" property.

Logical volume objects are children of their volume group object, and also link to it via the #VolumeGroup property.

Since 2.0.0

## Method Details

### The Activate() method

    Activate (IN  a{sv} options,
              OUT o     result);

Activate this logical volume, which makes it appear as a block device in the system.

Non-thin snapshots are always activated and deactivated together with their origins.

No additional options are currently defined.

`IN a{sv} `options``: | Additional options.
`OUT o `result``: | The UDisks2 object path of the block device.

Since 2.0.0

### The Deactivate() method

    Deactivate (IN  a{sv} options);

Deactivate this logical volume, which makes its block device disappear.

Non-thin snapshots are always activated and deactivated together with their origins.

No additional options are currently defined.

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

Since 2.0.0

### The Delete() method

    Delete (IN  a{sv} options);

Delete this logical volume.

If there are any non-thin snapshots of this logical volume, they will be deleted as well.

If this is a thin pool, all its contained thin volumes will be deleted as well.

If the option `tear-down` is set to `TRUE`, then the logical volume and all its children will be cleaned up before deletion. 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``: | Additional options.

Since 2.0.0

### The Rename() method

    Rename (IN  s     new_name,
            IN  a{sv} options,
            OUT o     result);

Rename this logical volume. This might cause the logical volume object to disappear from D-Bus and reappear with a different path.

No additional options are currently defined.

`IN s `new_name``: | The new name.
`IN a{sv} `options``: | Additional options.
`OUT o `result``: | The new object path.

Since 2.0.0

### The Resize() method

    Resize (IN  t     new_size,
            IN  a{sv} options);

Resize this logical volume.

Additional options:

resize_fsys (b): Whether to resize the filesystem on the logical volume as well. Default to 'false'.

force (b): Whether to force the resize even if it might destroy data.

pvs (ao): A list of physical volumes to allocate more space from.

`IN t `new_size``: | The new size, in bytes.
`IN a{sv} `options``: | Additional options.

Since 2.0.0

### The Repair() method

    Repair (IN  ao    pvs,
            IN  a{sv} options);

Attempt a repair of this logical volume after it has lost some physical volumes. Space is allocated from the given physical volumes as needed. A empty list means to allocate from all physical volumes.

No additional options are currently defined.

`IN ao `pvs``: | A list of physical volumes to use for the repair.
`IN a{sv} `options``: | Additional options.

Since 2.10.0

### The CreateSnapshot() method

    CreateSnapshot (IN  s     name,
                    IN  t     size,
                    IN  a{sv} options,
                    OUT o     result);

Create a snapshot of this logical volume.

When creating a snapshot of a non-thin volume, a non-zero size must be specified. A non-thin snapshot is created in this case.

When creating a snapshot of a thin volume, specifying a `size` of zero will create a thin snapshot in the same pool.

When creating a snapshot of a thin volume, specifying a non-zero `size` will create a non-thin snapshot.

No additional options are currently defined.

`IN s `name``: | The name of the snapshot.
`IN t `size``: | The size of the backing store for the snapshot, in bytes.
`IN a{sv} `options``: | Additional options.
`OUT o `result``: |

Since 2.0.0

### The CacheAttach() method

    CacheAttach (IN  s     cache_name,
                 IN  a{sv} options);

Creates cache LV. Logical volume which name is provided, will be formatted, converted to cache type and attached to origin logical volume as a cache pool LV. Logical volumes must be in the same volume group.

No additional options are currently defined.

`IN s `cache_name``: | The name of an existing volume.
`IN a{sv} `options``: | Additional options.

Since 2.3.0

### The CacheSplit() method

    CacheSplit (IN  a{sv} options);

Splits Cache LV to Cache pool LV and Origin LV, not afeecting its content.

No additional options are currently defined.

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

Since 2.3.0

### The CacheDetach() method

    CacheDetach (IN  a{sv} options);

Detaches the cached LV from its cache.

No additional options are currently defined.

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

Since 2.6.3

## Property Details

### The "VolumeGroup" property

    VolumeGroup  readable   o

The path of the volume group object that this logical volume belongs to.

Since 2.0.0

### The "Name" property

    Name  readable   s

The name of this logical volume, as it is known to LVM2.

Since 2.0.0

### The "Active" property

    Active  readable   b

Whether or not this volume is active.

Since 2.0.0

### The "UUID" property

    UUID  readable   s

The UUID of this logical volume. It is guaranteed to be unique within the group, but it might change over time.

Since 2.0.0

### The "Size" property

    Size  readable   t

The total size of this logical volume in bytes, including the size of the metadata.

Since 2.0.0

### The "DataAllocatedRatio" property

    DataAllocatedRatio  readable   d

For a thin pool or a non-thin snapshot, indicates how full the area for storing data is. A value of 1.0 corresponds to 100``.

Since 2.0.0

### The "MetadataAllocatedRatio" property

    MetadataAllocatedRatio  readable   d

For a thin pool or a non-thin snapshot, indicates how full the area for storing meta data is. A value of 1.0 corresponds to 100``.

Since 2.0.0

### The "Type" property

    Type  readable   s

The general type of a logical volume. One of "block", "pool" or "vdopool". More types might be defined in the future.

A volume of type "block" can be used as a block device. A volume of type "pool" can be used to create thin volumes. A volume of type "vdopool" is the internal pool for the VDO logical volume device.

Since 2.0.0

### The "Layout" property

    Layout  readable   s

The layout of this logical volume, such as "linear", "raid5", etc.

Since 2.10.0

### The "Structure" property

    Structure  readable   a{sv}

The detailed structure of how this logical volume is stored on physical volumes.

The following fields are present:

- name (s): The name of the logical volume. - type (s): The layout type of the logical volume. - size (t): The size in bytes of the logical volume.

If the logical volume is stored directly on physical volumes, this field is present as well:

- segs (a(tto)): Information about the segments of the logical volume (see below).

A segment is represented by a "(tto)" tuple, where the fields have these meanings:

- (t): The start of this segement on the physical volume, in bytes. - (t): The size of the segment, in bytes. - (o): The path of the org.freedesktop.UDisks.Block object of the physical volume.

For a healthy logical volume, the sizes of its segments will add up exactly to its own size. If a volume group has lost some physical volumes, a affected logical volume will have a list of segments here that do not add up to its full size.

If the logical volume is stored on other logical volumes, these fields are present in the "Structure" value instead of "segs":

- data (aa{sv}): The list of "Structure" objects for the data sub-volumes. - metadata (aa{sv}): The list of "Structure" objects for the metadata sub-volumes.

For example, a minimal "raid5" layout will have three "data" sub-volumes (and three parallel "metadata" sub-volumes), which are the three stripes of the RAID configuration. Each of those sub-volume will be stored directly on physical volumes and one can inspect the "segs" field of those to figure out how many are damaged. From that, one can deduce whether the RAID is degraded (exactly one damaged), or has lost data (more than one damaged).

Since 2.10.0

### The "SyncRatio" property

    SyncRatio  readable   d

How far along the logical volume is with resynchronizing. A value of 1.0 corresponds to fully synchronized and indicates that no operation is in progress. This is only relevant for logical volumes with some redundancy, like "raid1" or "raid5".

Since 2.10.0

### The "ThinPool" property

    ThinPool  readable   o

For a thin volume, the object path of its pool.

Since 2.0.0

### The "Origin" property

    Origin  readable   o

For a snapshot, the object path of its origin.

Since 2.0.0

### The "ChildConfiguration" property

    ChildConfiguration  readable   a(sa{sv})

Configuration items belonging to the

block device of this logical volume and its children. This is also valid when this logical volume is not currently active and there is no block device for it. It works via the 'track-parents' options of AddConfigurationItem(), which see.

Since 2.0.0

### The "BlockDevice" property

    BlockDevice  readable   o

For an active LV, the object path of its block device.

Since 2.7.1