org.freedesktop.UDisks2.Partition

org.freedesktop.UDisks2.Partition — Block device representing a partition

Methods

SetType  (IN  s     type,
          IN  a{sv} options);
SetName  (IN  s     name,
          IN  a{sv} options);
SetFlags (IN  t     flags,
          IN  a{sv} options);
Resize   (IN  t     size,
          IN  a{sv} options);
Delete   (IN  a{sv} options);

Properties

Number       readable   u
Type         readable   s
Flags        readable   t
Offset       readable   t
Size         readable   t
Name         readable   s
UUID         readable   s
Table        readable   o
IsContainer  readable   b
IsContained  readable   b

Description

This interface is used for org.freedesktop.UDisks2.Block devices that represent entries in a partition table.

Method Details

The SetType() method

SetType (IN  s     type,
         IN  a{sv} options);

Sets the partition type. See the "Type" property for a description of known partition types.

IN s type:

New type to set.

IN a{sv} options:

Options (currently unused except for standard options).


The SetName() method

SetName (IN  s     name,
         IN  a{sv} options);

Sets the partition name.

IN s name:

New name to set.

IN a{sv} options:

Options (currently unused except for standard options).


The SetFlags() method

SetFlags (IN  t     flags,
          IN  a{sv} options);

Sets the partition flags. See the "Flags" property for a description of known flags.

IN t flags:

New flags to set.

IN a{sv} options:

Options (currently unused except for standard options).


The Resize() method

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

since 2.7.2

Resizes the partition.

The partiton will not change its position but might be slightly bigger than requested due to sector counts and alignment (e.g. 1MiB). If the requested size can't be allocated it results in an error. The maximal size can automatically be set by using 0 as size.

IN t size:

New partition size in bytes, 0 for maximal size.

IN a{sv} options:

Options.


The Delete() method

Delete (IN  a{sv} options);

Deletes the partition.

If the option tear-down is set to TRUE, then the block device and all its children will be cleaned up before formatting. 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.

Property Details

The "Number" property

Number  readable   u

The number of the partition in the partition table.


The "Type" property

Type  readable   s

The type of the partition.

For dos partition tables, this string is a hexadecimal number e.g. 0x83 or 0xfd. For gpt partition tables this is the UUID e.g. ebd0a0a2-b9e5-4433-87c0-68b6b72699c7.


The "Flags" property

Flags  readable   t

Flags describing the partition.

Known flags for dos partitions include:

Bit 7

The partition is marked as bootable

Known flags for gpt partitions include:

Bit 0

System partition

Bit 2

Legacy BIOS Bootable

Bit 60

Read-only

Bit 62

Hidden

Bit 63

Do not automount


The "Offset" property

Offset  readable   t

Offset of partition, in bytes.


The "Size" property

Size  readable   t

Size of partition, in bytes.


The "Name" property

Name  readable   s

Label of partition or blank if not supported or unknown.


The "UUID" property

UUID  readable   s

The UUID of the partition or blank if not supported or unknown.


The "Table" property

Table  readable   o

The object path of the org.freedesktop.UDisks2.PartitionTable object that the partition entry belongs to.


The "IsContainer" property

IsContainer  readable   b

Set to TRUE if the partition itself is a container for other partitions.

For example, for dos partition tables, this applies to socalled extended partition (partitions of type 0x05, 0x0f or 0x85) containing socalled logical partitions.


The "IsContained" property

IsContained  readable   b

Set to TRUE of the partition is contained in another partition. See the "IsContainer" property for more information.