OpenMediaVault  3.0 (Erasmus)
The open network attached storage solution
Public Member Functions | List of all members
OMV\System\Storage\IStorageDevice Interface Reference
Inheritance diagram for OMV\System\Storage\IStorageDevice:
OMV\System\Storage\StorageDevice OMV\System\Storage\SmartStorageDeviceAbstract OMV\System\Storage\StorageDeviceBcache OMV\System\Storage\StorageDeviceCDROM OMV\System\Storage\StorageDeviceDM OMV\System\Storage\StorageDeviceI2O OMV\System\Storage\StorageDeviceLoop OMV\System\Storage\StorageDeviceMdadm OMV\System\Storage\StorageDeviceMMC OMV\System\Storage\StorageDeviceNVM OMV\System\Storage\StorageDeviceRDB

Public Member Functions

 exists ()
 
 getDeviceFile ()
 
 getCanonicalDeviceFile ()
 
 getDeviceFileById ()
 
 hasDeviceFileById ()
 
 getDeviceFileSymlinks ()
 
 getDeviceName ($canonical=FALSE)
 
 getSize ()
 
 getBlockSize ()
 
 getSectorSize ()
 
 getModel ()
 
 getVendor ()
 
 getSerialNumber ()
 
 getDescription ()
 
 isRotational ()
 
 isRemovable ()
 
 isRaid ()
 
 isUsb ()
 
 isAta ()
 
 isReadOnly ()
 
 isMediaAvailable ()
 
 hasSmartSupport ()
 

Detailed Description

Interface for storage devices.

Member Function Documentation

OMV\System\Storage\IStorageDevice::exists ( )

Checks if the device exists.

Returns
TRUE if the device exists, otherwise FALSE.

Implemented in OMV\System\Storage\StorageDeviceMdadm, and OMV\System\Storage\StorageDeviceLvm.

OMV\System\Storage\IStorageDevice::getBlockSize ( )

Get the blocksize of the device in bytes.

Returns
The blocksize of the device in bytes.
Exceptions
OMV\System\Storage\IStorageDevice::getCanonicalDeviceFile ( )

Get the canonical device file, e.g.

/dev/root -> /dev/sde1

  • /dev/disk/by-uuid/4B04EA317E4AA567 -> /dev/sdd1
  • /dev/mapper/vg0-lv0 -> /dev/dm-0
    Returns
    Returns the canonical device file.
OMV\System\Storage\IStorageDevice::getDescription ( )
OMV\System\Storage\IStorageDevice::getDeviceFile ( )

Get the device file, e.g. /dev/sda.

Returns
Returns the device file.
OMV\System\Storage\IStorageDevice::getDeviceFileById ( )

Get the device file by ID, e.g.

/dev/disk/by-id/wwn-0x5000cca211cc703c

  • /dev/disk/by-id/scsi-SATA_IBM-DHEA-36481_SG0SGF08038
  • /dev/disk/by-id/ata-Hitachi_HDT725032VLA360_VFD200R2CWB7ML-part2# The following order of paths will be retured if available:
    ata-xxx
  • wwn-xxx
  • scsi-xxx
  • ...
    Returns
    The device file (/dev/disk/by-id/xxx) if available, otherwise NULL will be returned.
OMV\System\Storage\IStorageDevice::getDeviceFileSymlinks ( )

Get all device file symlinks via udev, e.g.

/dev/disk/by-id/wwn-0x5000cca211cc703c

  • /dev/disk/by-id/scsi-SATA_IBM-DHEA-36481_SG0SGF08038
  • /dev/disk/by-id/ata-Hitachi_HDT725032VLA360_VFD200R2CWB7ML
  • /dev/disk/by-path/pci-0000:00:02.5-scsi-0:0:0:0
  • /dev/disk/by-id/ata-WDC_WD15EARS-00MVWB0_WD-WMAZB2574325-part1
  • /dev/disk/by-uuid/fc3e1da5-fd8d-4fda-341e-d0135efa7a7c
    Returns
    Returns an string array of device files.
OMV\System\Storage\IStorageDevice::getDeviceName (   $canonical = FALSE)

Get the device name, e.g. sda or hdb.

Parameters
canonicalIf set to TRUE the canonical device file will be used. Defaults to FALSE.
Returns
The device name.

Implemented in OMV\System\Storage\StorageDeviceCCISS.

OMV\System\Storage\IStorageDevice::getModel ( )

Get the device model.

Returns
The device model, otherwise an empty string.

Implemented in OMV\System\Storage\StorageDevice.

OMV\System\Storage\IStorageDevice::getSectorSize ( )

Get the sectorsize of the device in bytes.

Returns
The sectorsize of the device in bytes.
Exceptions
OMV\System\Storage\IStorageDevice::getSerialNumber ( )

Get the device serial number.

Returns
The device serial number, otherwise an empty string.

Implemented in OMV\System\Storage\StorageDeviceMdadm, and OMV\System\Storage\StorageDevice.

OMV\System\Storage\IStorageDevice::getSize ( )

Get the size of the device in bytes.

Returns
The size of the device in bytes.
Exceptions

Implemented in OMV\System\Storage\StorageDeviceLvm, and OMV\System\Storage\StorageDeviceCDROM.

OMV\System\Storage\IStorageDevice::getVendor ( )

Get the device vendor.

Returns
The device vendor, otherwise an empty string.

Implemented in OMV\System\Storage\StorageDevice.

OMV\System\Storage\IStorageDevice::hasDeviceFileById ( )

Check whether the device has a /dev/disk/by-id/xxx device path.

Returns
Returns TRUE if a disk/by-id device path exists, otherwise FALSE.
OMV\System\Storage\IStorageDevice::hasSmartSupport ( )

Check if the given device has S.M.A.R.T. support.

Returns
Returns TRUE if the device supports S.M.A.R.T., otherwise FALSE.

Implemented in OMV\System\Storage\StorageDevice.

OMV\System\Storage\IStorageDevice::isAta ( )

Check if the given device is connected via ATA.

Returns
TRUE if the device is connected via ATA, otherwise FALSE.

Implemented in OMV\System\Storage\StorageDevice.

OMV\System\Storage\IStorageDevice::isMediaAvailable ( )

Check if a medium is available. The method should always return TRUE for devices without removable media.

Returns
Set to FALSE if no medium is available.
OMV\System\Storage\IStorageDevice::isRaid ( )

Check if the given device is a hardware/software RAID device.

Returns
TRUE if the device is a hardware/software RAID, otherwise FALSE.

Implemented in OMV\System\Storage\StorageDeviceMdadm, OMV\System\Storage\StorageDevice, OMV\System\Storage\StorageDeviceCCISS, and OMV\System\Storage\StorageDeviceI2O.

OMV\System\Storage\IStorageDevice::isReadOnly ( )

Check if the given device is read-only.

Returns
TRUE if the device is read-only, otherwise FALSE.

Implemented in OMV\System\Storage\StorageDevice, and OMV\System\Storage\StorageDeviceCDROM.

OMV\System\Storage\IStorageDevice::isRemovable ( )

Check if the device is removable.

Returns
TRUE if device is removable, otherwise FALSE.

Implemented in OMV\System\Storage\StorageDevice.

OMV\System\Storage\IStorageDevice::isRotational ( )

Check if the device is of rotational type or non-rotational type. See https://www.kernel.org/doc/Documentation/block/queue-sysfs.txt

Returns
TRUE if device is of rotational type, otherwise FALSE.

Implemented in OMV\System\Storage\StorageDevice, OMV\System\Storage\StorageDeviceMMC, OMV\System\Storage\StorageDeviceNVM, and OMV\System\Storage\StorageDeviceRDB.

OMV\System\Storage\IStorageDevice::isUsb ( )

Check if the given device is an USB device.

Returns
TRUE if the device is a connected via USB, otherwise FALSE.

Implemented in OMV\System\Storage\StorageDevice.


The documentation for this interface was generated from the following file: