org.freedesktop.UDisks2.Drive

## org.freedesktop.UDisks2.Drive org.freedesktop.UDisks2.Drive — Disk drives |

## Methods

    Eject (IN  a{sv} options);

## Properties

    Vendor                 readable   s
    Model                  readable   s
    Revision               readable   s
    Serial                 readable   s
    WWN                    readable   s
    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

## Description

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.

## Method Details

### The Eject() method

    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”.

`IN a{sv} `options``: | Options (currently unused except for standard options).

## Property Details

### The "Vendor" property

    Vendor  readable   s

A name for the vendor of the drive or blank if unknown.

### The "Model" property

    Model  readable   s

A name for the model of the drive or blank if unknown.

### The "Revision" property

    Revision  readable   s

Firmware Revision or blank if unknown.

### The "Serial" property

    Serial  readable   s

Serial number of the drive or blank if unknown.

### The "WWN" property

    WWN  readable   s

The World Wide Name of the drive or blank if unknown.

### The "Media" property

    Media  readable   s

The kind of media currently in the drive or blank if unknown.

See the "MediaCompatibility" property for known values.

### The "MediaCompatibility" property

    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_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

### The "MediaRemovable" property

    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.

### The "MediaAvailable" property

    MediaAvailable  readable   b

Set to `FALSE` if no medium is available.

This is always `TRUE` if "MediaChangeDetected" is `FALSE`.

### The "MediaChangeDetected" property

    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.

### The "Size" property

    Size  readable   t

The size of the drive (or the media currently in the drive).

This is always 0 if "MediaChangeDetected" is `FALSE`.

### The "TimeDetected" property

    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.

### The "TimeMediaDetected" property

    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.

### The "Optical" property

    Optical  readable   b

`TRUE` if the drive contains an optical disc.

### The "OpticalBlank" property

    OpticalBlank  readable   b

`TRUE` if the disc is blank.

This is only valid if the property "Optical" is `TRUE`.

### The "OpticalNumTracks" property

    OpticalNumTracks  readable   u

The number of tracks.

This is only valid if the property "Optical" is `TRUE`.

### The "OpticalNumAudioTracks" property

    OpticalNumAudioTracks  readable   u

The number of audio tracks.

This is only valid if the property "Optical" is `TRUE`.

### The "OpticalNumDataTracks" property

    OpticalNumDataTracks  readable   u

The number of data tracks.

This is only valid if the property "Optical" is `TRUE`.

### The "OpticalNumSessions" property

    OpticalNumSessions  readable   u

The number of sessions.

This is only valid if the property "Optical" is `TRUE`.

### The "RotationRate" property

    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

### The "ConnectionBus" property

    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 SDIO
ieee1394 | Connected via Firewire

### The "Seat" property

    Seat  readable   s

A string identifying what seat the drive is plugged into, if any.

### The "Removable" property

    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.

### The "Ejectable" property

    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.

### The "SortKey" property

    SortKey  readable   s

A string that can be used for sorting drive objects.