Top | ![]() |
![]() |
![]() |
![]() |
Eject (IN a{sv} options); SetConfiguration (IN a{sv} value, IN a{sv} options); PowerOff (IN a{sv} options);
Vendor readable s Model readable s Revision readable s Serial readable s WWN readable s Id readable s Configuration readable a{sv} Media readable s MediaCompatibility readable as MediaRemovable readable b MediaAvailable readable b MediaChangeDetected readable b Size readable t TimeDetected readable t TimeMediaDetected readable t Optical readable b OpticalBlank readable b OpticalNumTracks readable u OpticalNumAudioTracks readable u OpticalNumDataTracks readable u OpticalNumSessions readable u RotationRate readable i ConnectionBus readable s Seat readable s Removable readable b Ejectable readable b SortKey readable s CanPowerOff readable b SiblingId readable s
This interface is used to represent both hard disks and disk drives (with or without removable media).
This interface should not to be confused with the
org.freedesktop.UDisks2.Block interface that is used for
low-level block devices the OS knows about. For example, if
/dev/sda
and /dev/sdb
are block devices for two paths to the same drive, there will be
only one org.freedesktop.UDisks2.Drive object but two
org.freedesktop.UDisks2.Block objects.
Eject (IN a{sv} options);
Ejects media from the drive. This is only meaningful to do on drives with removable media.
There are not a lot of guarantees associated with this method so it should only be called in response to an user action.
On some hardware the media may be physically ejected while on other hardware may simply eject the disc. On some hardware it may not do anything physical but it may cause e.g. a display on the hardware to show e.g. “It is now safe to remove the device”.
|
Options (currently unused except for standard options). |
SetConfiguration (IN a{sv} value, IN a{sv} options);
Sets the configuration for the drive. This will store the configuration in the file-system and also apply it to the drive.
See the "Configuration" property
for details about valid values and the location of the
configuration file that value
will be written to.
|
The configuration value to set. |
|
Options (currently unused except for standard options). |
PowerOff (IN a{sv} options);
Arranges for the drive to be safely removed and powered off. On the OS side this includes ensuring that no process is using the drive, then requesting that in-flight buffers and caches are committed to stable storage. The exact steps for powering off the drive depends on the drive itself and the interconnect used. For drives connected through USB, the effect is that the USB device will be deconfigured followed by disabling the upstream hub port it is connected to.
Note that as some physical devices contain multiple drives (for example 4-in-1 flash card reader USB devices) powering off one drive may affect other drives. Applications can examine the "SiblingId" property to determine such relationships.
There are not a lot of guarantees associated with this method so it should only be called in response to an user action. Usually the effect is that the drive disappears as if it was unplugged.
This method only works if the
"CanPowerOff" property
is set to TRUE
.
|
Options (currently unused except for standard options). |
Since 2.0.0
WWN readable s
The World Wide Name of the drive or blank if unknown.
In case of NVMe drives please refer to namespace-level WWN properties.
Id readable s
A unique and persistent identifier for the device or blank if no such identifier is available.
This identifier is guaranteed to not include the slash character '/' (U+002F SOLIDUS) which means it can be used as a filename.
Examples: “ST32000542AS-6XW00W51”, “HITACHI-HTS723232A7A364-E3834563KRG2HN”, “INTEL-SSDSA2MH080G1GC-CVEM842101HD080DGN”.
Configuration readable a{sv}
A set of configuration directives that are applied to the drive when it is connected (e.g. at start-up, hotplug or resume).
This is an dict of items with the following known keys:
ata-pm-standby (type |
The spindown timeout for ATA drives (See ATA command “STANDBY”). |
ata-apm-level (type |
The APM level for ATA drives (See ATA command “SET FEATURES”, sub-commands 0x05 and 0x85). |
ata-aam-level (type |
The AAM level for ATA drives (See ATA command “SET FEATURES”, sub-commands 0x42 and 0xc2). |
ata-write-cache-enabled (type |
Whether the write-cache is enabled (See ATA command “SET FEATURES”, sub-commands 0x82 and 0x02). Since 2.1. |
ata-read-lookahead-enabled (type |
Whether the read look-ahead is enabled (See ATA command “SET FEATURES”, sub-commands 0x55 and 0xaa). Since 2.1.7. |
The contents of this property is read from the configuration
file /etc/udisks2/IDENTIFIER.conf
where IDENTIFIER is the value of the
"Id" property. See udisks(8) for the file format of this file.
Use the SetConfiguration() method to change the value of this property.
Media readable s
The kind of media currently in the drive or blank if unknown.
See the "MediaCompatibility" property for known values.
MediaCompatibility readable as
The physical kind of media the drive uses or the type of the drive or blank if unknown. Known values include
thumb |
The device is a thumb-drive with non-removable media (e.g. a USB stick) |
flash |
Flash Card |
flash_cf |
CompactFlash |
flash_ms |
MemoryStick |
flash_sm |
SmartMedia |
flash_sd |
Secure Digital |
flash_sdhc |
Secure Digital High Capacity |
flash_sdxc |
Secure Digital eXtended Capacity |
flash_sdio |
Secure Digital Input Output |
flash_sd_combo |
Secure Digital Input Output combo card with storage and I/O functionality |
flash_mmc |
MultiMediaCard |
floppy |
Floppy Disk |
floppy_zip |
Zip Disk |
floppy_jaz |
Jaz Disk |
optical |
Optical Disc |
optical_cd |
Compact Disc |
optical_cd_r |
Compact Disc Recordable |
optical_cd_rw |
Compact Disc Rewritable |
optical_dvd |
Digital Versatile Disc |
optical_dvd_r |
DVD-R |
optical_dvd_rw |
DVD-RW |
optical_dvd_ram |
DVD-RAM |
optical_dvd_plus_r |
DVD+R |
optical_dvd_plus_rw |
DVD+RW |
optical_dvd_plus_r_dl |
DVD+R Dual Layer |
optical_dvd_plus_rw_dl |
DVD+RW Dual Layer |
optical_bd |
Blu-ray Disc |
optical_bd_r |
Blu-ray Recordable |
optical_bd_re |
Blu-ray Rewritable |
optical_hddvd |
HD-DVD |
optical_hddvd_r |
HD-DVD Recordable |
optical_hddvd_rw |
HD-DVD Rewritable |
optical_mo |
Magneto Optical |
optical_mrw |
Can read Mount Rainer media |
optical_mrw_w |
Can write Mount Rainer media |
MediaRemovable readable b
Whether the media can be removed from the drive.
Note that this may be overridden from what the hardware reports - for example, USB thumb drives often report that they are using removable media while in fact the media is not removable.
MediaAvailable readable b
Set to FALSE
if no medium is available.
This is always TRUE
if "MediaChangeDetected" is FALSE
.
MediaChangeDetected readable b
Set to TRUE
only if media changes are detected.
Media changes are detected on all modern disk drives through either polling or an asynchronous notification mechanism. The only known disk drives that cannot report media changes are PC floppy drives.
Size readable t
The size of the drive (or the media currently in the drive).
In case of NVMe this value indicates the total NVM capacity that is accessible by the NVMe controller.
This is always 0 if "MediaChangeDetected" is FALSE
.
TimeDetected readable t
The time the drive was first detected.
This is expressed in micro-seconds since the Epoch Jan 1, 1970 0:00 UTC.
TimeMediaDetected readable t
The earliest time media was last detected or 0 if media is not available.
This is expressed in micro-seconds since the Epoch Jan 1, 1970 0:00 UTC.
OpticalBlank readable b
TRUE
if the disc is blank.
This is only valid if the property "Optical" is TRUE
.
OpticalNumTracks readable u
The number of tracks.
This is only valid if the property "Optical" is TRUE
.
OpticalNumAudioTracks readable u
The number of audio tracks.
This is only valid if the property "Optical" is TRUE
.
OpticalNumDataTracks readable u
The number of data tracks.
This is only valid if the property "Optical" is TRUE
.
OpticalNumSessions readable u
The number of sessions.
This is only valid if the property "Optical" is TRUE
.
RotationRate readable i
The rotational rate of the drive.
-1 if known to be rotating media but rotation rate isn't known
0 if known to be non-rotating media
the rotation rate in rounds per minute otherwise
ConnectionBus readable s
The physical connection bus used for the drive as seen by the user. This is typically used to draw a USB or Firewire emblem on top of an icon in an user interface.
Note that this property has nothing to do with the low-level command-set used (such as ATA-8) or what low-level connection bus (such as SATA, eSATA, PATA, SAS2 etc) is used.
Known values include:
usb |
Connected via USB |
sdio |
Connected via SDHC or SDIO controller (including eMMC). |
ieee1394 |
Connected via Firewire |
Seat readable s
A string identifying what seat the drive is plugged into, if any.
Removable readable b
A hint whether the drive and/or its media is considered removable by the user.
This includes drives with removable media (cf. the "MediaRemovable" property), Flash media such as SD cards and drives on hotpluggable buses such as USB or Firewire (cf. the "ConnectionBus" property).
Note that this is only a guess.
Ejectable readable b
Whether the media can be ejected from the drive or the drive accepts an eject command to switch its state so it displays e.g. a "Safe To Remove" message to the user.
Note that this is only a guess.
CanPowerOff readable b
Whether the drive can be safely removed / powered off. See the PowerOff() method for more information.
See udisks(8) for how to influence the value of this property.
Since 2.0.0