## org.freedesktop.UDisks2.PartitionTable org.freedesktop.UDisks2.PartitionTable — Block device containing a partition table |

## Methods

    CreatePartition          (IN  t     offset,
                              IN  t     size,
                              IN  s     type,
                              IN  s     name,
                              IN  a{sv} options,
                              OUT o     created_partition);
    CreatePartitionAndFormat (IN  t     offset,
                              IN  t     size,
                              IN  s     type,
                              IN  s     name,
                              IN  a{sv} options,
                              IN  s     format_type,
                              IN  a{sv} format_options,
                              OUT o     created_partition);

## Properties

    Partitions  readable   ao
    Type        readable   s

## Description

This interface is used for org.freedesktop.UDisks2.Block devices that contain a partition table.

## Method Details

### The CreatePartition() method

    CreatePartition (IN  t     offset,
                     IN  t     size,
                     IN  s     type,
                     IN  s     name,
                     IN  a{sv} options,
                     OUT o     created_partition);

Creates a new partition.

Note that the created partition won't necessarily be created at the exact `offset` but slightly behind due to disk geometry and other alignment constraints (e.g. 1MiB alignment).

The newly created partition may also end up being slightly larger than the requested `size` bytes for the same reasons. The maximal size can be automatically set by using 0 as size.

For `dos` partition tables, the partition type can be set with the `partition`-type option. Possible values are: "primary", "extended" or "logical".

An optional parameter `partition-uuid` denotes the partition UUID to set for the newly created partition (GPT only).

The newly created partition will be wiped of known filesystem signatures using the wipefs(8) command.

`IN t `offset``: | The desired offset where the partition should be created, in bytes.
`IN t `size``: | The desired size of the partition, in bytes (0 for maximal size).
`IN s `type``: | The type of partition to create (cf. the "Type" property) or blank to use the default for the partition table type and OS.
`IN s `name``: | The name for the new partition or blank if the partition table do not support names.
`IN a{sv} `options``: | Options - known options (in addition to standard options) include `partition-type` (of type 's') and `partition-uuid` (of type 's').
`OUT o `created_partition``: | An object path to the created block device object implementing the org.freedesktop.UDisks2.Partition interface.

### The CreatePartitionAndFormat() method

    CreatePartitionAndFormat (IN  t     offset,
                              IN  t     size,
                              IN  s     type,
                              IN  s     name,
                              IN  a{sv} options,
                              IN  s     format_type,
                              IN  a{sv} format_options,
                              OUT o     created_partition);

This is a combination of org.freedesktop.UDisks2.PartitionTable:CreatePartition and org.freedesktop.UDisks2.Block:Format. After creating the partition, the resulting block device is formatted.

`IN t `offset``: | The desired offset where the partition should be created, in bytes.
`IN t `size``: | The desired size of the partition, in bytes (0 for maximal size).
`IN s `type``: | The type of partition to create (cf. the "Type" property) or blank to use the default for the partition table type and OS.
`IN s `name``: | The name for the new partition or blank if the partition table do not support names.
`IN a{sv} `options``: | Options - known options (in addition to standard options) include `partition-type` (of type 's') and `partition-uuid` (of type 's').
`IN s `format_type``: | The type to use for Format.
`IN a{sv} `format_options``: | Options for Format.
`OUT o `created_partition``: | An object path to the created block device object implementing the org.freedesktop.UDisks2.Partition interface.

## Property Details

### The "Partitions" property

    Partitions  readable   ao

List of object paths of the org.freedesktop.UDisks2.Partition

objects that belongs to this partition table. `since`: 2.7.2

### The "Type" property

    Type  readable   s

The type of partition table detected.

Known values include:

dos | Master Boot Record
gpt | GUID Partition Table

If blank it means that a partition table was detected but its scheme is unknown.