org.freedesktop.UDisks2.Drive.Ata

org.freedesktop.UDisks2.Drive.Ata — Disk drives using the ATA command-set

Methods

SmartUpdate        (IN  a{sv}            options);
SmartGetAttributes (IN  a{sv}            options,
                    OUT a(ysqiiixia{sv}) attributes);
SmartSelftestStart (IN  s                type,
                    IN  a{sv}            options);
SmartSelftestAbort (IN  a{sv}            options);

Properties

SmartSupported                     readable   b
SmartEnabled                       readable   b
SmartUpdated                       readable   t
SmartFailing                       readable   b
SmartPowerOnSeconds                readable   t
SmartTemperature                   readable   d
SmartNumAttributesFailing          readable   i
SmartNumAttributesFailedInThePast  readable   i
SmartNumBadSectors                 readable   x
SmartSelftestStatus                readable   s
SmartSelftestPercentRemaining      readable   i

Description

Objects implementing this interface also implement the org.freedesktop.UDisks2.Drive interface.

Method Details

The SmartUpdate() method

SmartUpdate (IN  a{sv} options);

Reads SMART data from the drive and update relevant properties.

If the option nowakeup is given and the disk is in a sleeping state, the error org.freedesktop.UDisks2.Error.WouldWakeup is returned.

The option atasmart_blob can be used to inject libatasmart compatible blobs for testing how clients react to different kinds of SMART data. Only uid 0 may use this. This option may be removed in the future with it being considered an ABI break - it only exists for testing purposes. Example:

# export ATA_SMART_BLOB=/usr/share/doc/libatasmart-devel-0.17/Maxtor_96147H8--BAC51KJ0--2 ; \
  gdbus call --system --dest org.freedesktop.UDisks2 \
             --object-path /org/freedesktop/UDisks2/drives/WDC_WD1002FAEX_00Y9A0_WD_WCAW30039835 \
             --method org.freedesktop.UDisks2.Drive.Ata.SmartUpdate \
             "{'atasmart_blob': <'$ATA_SMART_BLOB'>}"

IN a{sv} options:

Options - known options (in addition to standard options) includes nowakeup (of type 'b').


The SmartGetAttributes() method

SmartGetAttributes (IN  a{sv}            options,
                    OUT a(ysqiiixia{sv}) attributes);

Get the SMART attributes. Each attribute is a struct with the following members:

id (type 'y')

Attribute Identifier

name (type 's')

The identifier as a string.

flags (type 'q')

16-bit attribute flags (bit 0 is prefail/oldage, bit 1 is online/offline).

value (type 'i')

The current value or -1 if unknown.

worst (type 'i')

The worst value of -1 if unknown.

threshold (type 'i')

The threshold or -1 if unknown.

pretty (type 'x')

An interpretation of the value - must be ignored if pretty_unit is 0.

pretty_unit (type 'i')

The unit of the pretty value - the following units are known: 0 (unknown), 1 (dimensionless), 2 (milliseconds), 3 (sectors), 4 (millikelvin).

expansion (type 'a{sv}')

Currently unused. Intended for future expansion.

The name parameter should be used as the authoritative identifier for the attribute since it is derived from the numerical id and the disk's IDENTIFY data and thus handles ID collisions between drives of different make and model.

IN a{sv} options:

Options - known options (in addition to standard options) includes nowakeup (of type 'b').

OUT a(ysqiiixia{sv}) attributes:

The SMART attributes.


The SmartSelftestStart() method

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

Starts a SMART selftest. The type parameter is for the type of test to start - valid values are short, extended and conveyance.

Note that the method returns immediately after the test has been started successfully.

IN s type:

The type test to run.

IN a{sv} options:

Options (currently unused except for standard options).


The SmartSelftestAbort() method

SmartSelftestAbort (IN  a{sv} options);

Aborts a running SMART selftest.

IN a{sv} options:

Options (currently unused except for standard options).

Property Details

The "SmartSupported" property

SmartSupported  readable   b

Whether the drive supports SMART.


The "SmartEnabled" property

SmartEnabled  readable   b

Whether SMART is enabled.


The "SmartUpdated" property

SmartUpdated  readable   t

The point in time (seconds since the Unix Epoch) that the SMART status was updated or 0 if never updated.

The value of the other properties related to SMART are not meaningful if this proeprty is 0.


The "SmartFailing" property

SmartFailing  readable   b

Set to TRUE if disk is about to fail.

This value is read from the disk itself and does not include any interpretation.


The "SmartPowerOnSeconds" property

SmartPowerOnSeconds  readable   t

The amount of time the disk has been powered on (according to SMART data) or 0 if unknown.


The "SmartTemperature" property

SmartTemperature  readable   d

The temperature (in Kelvin) of the disk according to SMART data or 0 if unknown.


The "SmartNumAttributesFailing" property

SmartNumAttributesFailing  readable   i

The number of attributes failing right now or -1 if unknown.


The "SmartNumAttributesFailedInThePast" property

SmartNumAttributesFailedInThePast  readable   i

The number of attributes that have failed in the past or -1 if unknown.


The "SmartNumBadSectors" property

SmartNumBadSectors  readable   x

The number of bad sectors (ie. pending and reallocated) or -1 if unknown.


The "SmartSelftestStatus" property

SmartSelftestStatus  readable   s

The status of the last self-test. Known values include

success

Last self-test was a success (or never ran).

aborted

Last self-test was aborted.

interrupted

Last self-test was interrupted.

fatal

Last self-test did not complete.

error_unknown

Last self-test failed (Unknown).

error_electrical

Last self-test failed (Electrical).

error_servo

Last self-test failed (Servo).

error_read

Last self-test failed (Read).

error_handling

Last self-test failed (Damage).

inprogress

Self-test is currently in progress.


The "SmartSelftestPercentRemaining" property

SmartSelftestPercentRemaining  readable   i

The percent remaining or -1 if unknown.