| UDisks Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Properties | ||||
AddConfigurationItem (IN (sa{sv}) item, IN a{sv} options); RemoveConfigurationItem (IN (sa{sv}) item, IN a{sv} options); UpdateConfigurationItem (IN (sa{sv}) old_item, IN (sa{sv}) new_item, IN a{sv} options); GetSecretConfiguration (IN a{sv} options, OUT a(sa{sv}) configuration); Format (IN s type, IN a{sv} options); OpenForBackup (IN a{sv} options, OUT h fd); OpenForRestore (IN a{sv} options, OUT h fd);
Device readable ay PreferredDevice readable ay Symlinks readable aay DeviceNumber readable t Size readable t ReadOnly readable b Drive readable o IdUsage readable s IdType readable s IdVersion readable s IdLabel readable s IdUUID readable s Configuration readable a(sa{sv}) CryptoBackingDevice readable o HintPartitionable readable b HintSystem readable b HintIgnore readable b HintAuto readable b HintName readable s HintIconName readable s
This interface represents a block device.
This should not be confused with the org.freedesktop.UDisks2.Drive interface that is used to represent disk drives. For example, the org.freedesktop.UDisks2.Block interface is also used for block devices that do not correspond to drives at all (e.g. Loop Devices).
AddConfigurationItem (IN (sa{sv}) item,
IN a{sv} options);
Adds a new configuration item.
See the "Configuration" property for details about valid configuration items.
|
The configuration item to add. |
|
Options (currently unused except for standard options). |
RemoveConfigurationItem (IN (sa{sv}) item,
IN a{sv} options);
Removes an existing configuration item.
See the "Configuration" property for details about valid configuration items.
|
The configuration item to remove. |
|
Options (currently unused except for standard options). |
UpdateConfigurationItem (IN (sa{sv}) old_item,
IN (sa{sv}) new_item,
IN a{sv} options);
Removes a configuration item and adds a new one. This is
equivalent to calling
RemoveConfigurationItem()
followed by
AddConfigurationItem()
with the change that only one PolicyKit check is made
and that new_item can be validated against old_item.
See the "Configuration" property for details about valid configuration items.
|
The configuration item to remove. |
|
The configuration item to add. Must be of the same type as |
|
Options (currently unused except for standard options). |
GetSecretConfiguration (IN a{sv} options,
OUT a(sa{sv}) configuration);
Returns the same value as in the "Configuration" property but without secret information filtered out.
|
Options (currently unused except for standard options). |
|
The resulting configuration. |
Format (IN s type,
IN a{sv} options);
Formats the device with a file system, partition table or other well-known content.
Known values for type includes empty (to
just zero out areas of the device known to host file system
signatures) and swap (Linux swap space)
and most file systems supported by the mkfs(8)
program through its -t option.
Known partition table formats includes
dos and gpt.
If type supports it, you can specify a label with the
label option in the options parameter;
however, note that this may not be supported on all file
systems and, if supported, the maximum allowed length may
vary.
If the file system in question supports owners and the option
take-ownership is set to TRUE then the
root directory of the created file system will be owned by the
caller of this method.
If the option encrypt.passphrase is
given then a LUKS device is created with the given passphrase
and the file system is created on the unlocked device. The
unlocked device will be left open.
|
The type of file system, partition table or other content to format the device with. |
|
Options - known options (in addition to standard options) includes |
OpenForBackup (IN a{sv} options,
OUT h fd);
Gets a read-only file descriptor for the device intended for a byte-by-byte imaging of the device. This can only be done if the device is not already in use.
|
Options (currently unused except for standard options). |
|
An index for the returned file descriptor. |
OpenForRestore (IN a{sv} options,
OUT h fd);
Gets a writable file descriptor for the device intended for a byte-by-byte restore of a disk image onto the device. This can only be done if the device is not already in use.
|
Options (currently unused except for standard options). |
|
An index for the returned file descriptor. |
Device readable ay
The special device file for the block device e.g. /dev/sda2.
PreferredDevice readable ay
The special device file to present in the UI instead of the value of the "Device" property.
For example this could be
e.g. /dev/mapper/mpathk for a multipath
device with special device file /dev/dm-9.
Symlinks readable aay
Known symlinks in /dev that points to
the device file in the
"Device" property.
For example, this array could include symlinks such as
/dev/disk/by-id/ata-INTEL_SSDSA2MH080G1GC_CVEM842101HD080DGN
and
/dev/disk/by-id/wwn-0x5001517387d61905.
ReadOnly readable b
If TRUE, the device can not be written to, only read from.
Drive readable o
The org.freedesktop.UDisks2.Drive object that the block device belongs to, or '/' if no such object exists.
IdUsage readable s
A result of probing for signatures on the block device. Known values include:
filesystem |
Used for mountable filesystems |
crypto |
Used for e.g. LUKS devices |
raid |
Used for e.g. RAID members and LVM PVs |
other |
Something else was detected. |
If blank, no known signature was detected. This doesn't necessarily mean the device contains no structured data; it only means that no signature known to the probing code was detected.
Applications should not rely on the value in this or the "IdType" property - instead, applications should check for whether the object in question implements interfaces such as e.g. org.freedesktop.UDisks2.Filesystem, org.freedesktop.UDisks2.Swapspace or org.freedesktop.UDisks2.Encrypted.
IdType readable s
This property contains more information about the result of probing the block device. Its value depends of the value the "IdUsage" property:
filesystem |
The mountable file system that was detected (e.g. |
crypto |
Encrypted data. Known values include |
raid |
RAID or similar. Known values include |
other |
Something else. Known values include |
See the note for the "IdUsage" property about usage.
IdVersion readable s
The version of the filesystem or other structured data on the block device. Do not make any assumptions about the format.
This property is blank if there is no version or the version is unknown.
IdLabel readable s
The label of the filesystem or other structured data on the block device.
This property is blank if there is no label or the label is unknown.
IdUUID readable s
The UUID of the filesystem or other structured data on the block device. Do not make any assumptions about the UUID as its format depends on what kind of data is on the device.
This property is blank if there is no UUID or the UUID is unknown.
Configuration readable a(sa{sv})
The configuration for the device.
This is an array of pairs of (type, details) where type is
a string identifying the configuration source
(e.g. fstab) and details contains the
actual configuration data.
Use the AddConfigurationItem(), RemoveConfigurationItem() and UpdateConfigurationItem() methods to add, remove and update configuration items.
Use GetSecretConfiguration() to get the secrets (e.g. passphrases) that may be part of the configuration but isn't exported in this property for security reasons.
For entries of type fstab, it means that
the block device is referenced in the system-wide
/etc/fstab file. Known configuration
items for type fstab are
fsname (type |
The special device |
dir (type |
The mount point |
type (type |
The filesystem type |
opts (type |
Options |
freq (type |
Dump frequency in days |
passno (type |
Pass number of parallel fsck |
For entries of type crypttab, it means that
the block device is referenced in the system-wide
/etc/crypttab file. Known configuration
items for type crypttab are
name (type |
The name to set the device up as |
device (type |
The special device |
passphrase-path (type |
Either empty to specify that no password is set,
otherwise a path to a file containing the encryption password.
This may also point to a special device file in |
passphrase-contents (type |
The contents of the file containing the encryption password, if applicable. This is only available via the GetSecretConfiguration() method. |
opts (type |
Options |
For security reasons, when creating a new
crypttab entry (via the
AddConfigurationItem()
method), then the passphrase-path must
reference an unexisting file in the
/etc/luks-keys directory.
CryptoBackingDevice readable o
The org.freedesktop.UDisks2.Block object that is
backing the device or / if unknown or if
the block device is not the cleartext device for an encrypted
device.
HintPartitionable readable b
If TRUE, the device is normally expected to be
partitionable. Devices for which this is not the case include
floppy drives, optical drives and LVM logical volumes.
HintSystem readable b
If TRUE, the device is considered a system device.
System devices are devices that require additional permissions to access.
See udisks(8) for how to influence the value of this property.
HintIgnore readable b
If TRUE, the device should be hidden from users.
See udisks(8) for how to influence the value of this property.
HintAuto readable b
If TRUE, the device should be automatically started (e.g. mounted, unlocked etc.).
See udisks(8) for how to influence the value of this property.
HintName readable s
If not blank, the name to use when presenting the device.
See udisks(8) for how to influence the value of this property.
HintIconName readable s
If not blank, the icon name to use when presenting the device.
The name must adhere to the freedesktop.org icon theme specification.
See udisks(8) for how to influence the value of this property.