openmediavault  4.0 (Arrakis)
The open network attached storage solution
Public Member Functions | List of all members
OMV\System\IBlockDevice Interface Reference
Inheritance diagram for OMV\System\IBlockDevice:
OMV\System\BlockDevice OMV\System\Filesystem\Filesystem OMV\System\Storage\StorageDevice OMV\System\Filesystem\Btrfs OMV\System\Filesystem\Ext OMV\System\Filesystem\Jfs OMV\System\Filesystem\Xfs 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 OMV\System\Storage\StorageDeviceXen

Public Member Functions

 exists ()
 
 getDeviceFile ()
 
 getCanonicalDeviceFile ()
 
 getDeviceFileById ()
 
 hasDeviceFileById ()
 
 getDeviceFileByPath ()
 
 hasDeviceFileByPath ()
 
 getPredictableDeviceFile ()
 
 getPreferredDeviceFile ()
 
 getDeviceFileSymlinks ()
 
 getDeviceName ($canonical=FALSE)
 
 getDeviceNumber ()
 
 getMajor ()
 
 getMinor ()
 
 getSize ()
 
 getBlockSize ()
 
 getSectorSize ()
 
 getDescription ()
 
 waitForDevice ($timeout)
 

Detailed Description

Interface for block devices.

Member Function Documentation

◆ exists()

OMV\System\IBlockDevice::exists ( )

Checks if the device exists.

Returns
TRUE if the device exists, otherwise FALSE.

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

◆ getBlockSize()

OMV\System\IBlockDevice::getBlockSize ( )

Get the blocksize of the device in bytes.

Returns
The blocksize of the device in bytes.
Exceptions

Implemented in OMV\System\Filesystem\Filesystem, and OMV\System\BlockDevice.

◆ getCanonicalDeviceFile()

OMV\System\IBlockDevice::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.

Implemented in OMV\System\BlockDevice.

◆ getDescription()

OMV\System\IBlockDevice::getDescription ( )

◆ getDeviceFile()

OMV\System\IBlockDevice::getDeviceFile ( )

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

Returns
Returns the device file.

Implemented in OMV\System\Filesystem\Filesystem, and OMV\System\BlockDevice.

◆ getDeviceFileById()

OMV\System\IBlockDevice::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.

Implemented in OMV\System\Filesystem\Filesystem, and OMV\System\BlockDevice.

◆ getDeviceFileByPath()

OMV\System\IBlockDevice::getDeviceFileByPath ( )

Get the device file by PATH, e.g.

/dev/disk/by-path/pci-0000:00:17.0-ata-3

  • /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0
  • /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part1
    Returns
    The device file (/dev/disk/by-path/xxx) if available, otherwise NULL will be returned.

Implemented in OMV\System\BlockDevice.

◆ getDeviceFileSymlinks()

OMV\System\IBlockDevice::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.

Implemented in OMV\System\BlockDevice.

◆ getDeviceName()

OMV\System\IBlockDevice::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\BlockDevice, and OMV\System\Storage\StorageDeviceCCISS.

◆ getDeviceNumber()

OMV\System\IBlockDevice::getDeviceNumber ( )

Get the device number, e.g. 8:17. https://www.kernel.org/doc/Documentation/devices.txt for more information.

Returns
The device number as string or FALSE on failure.

Implemented in OMV\System\BlockDevice.

◆ getMajor()

OMV\System\IBlockDevice::getMajor ( )

Get the major device number. https://www.kernel.org/doc/Documentation/devices.txt for more information.

Returns
The major device number or FALSE on failure.

Implemented in OMV\System\BlockDevice.

◆ getMinor()

OMV\System\IBlockDevice::getMinor ( )

Get the minor device number. https://www.kernel.org/doc/Documentation/devices.txt for more information.

Returns
The minor device number or FALSE on failure.

Implemented in OMV\System\BlockDevice.

◆ getPredictableDeviceFile()

OMV\System\IBlockDevice::getPredictableDeviceFile ( )

Get a predictable device file in the following order:

/dev/disk/by-id/xxx

  • /dev/disk/by-path/xxx
  • /dev/xxx
    Returns
    Returns a device file.

Implemented in OMV\System\Filesystem\Filesystem, and OMV\System\BlockDevice.

◆ getPreferredDeviceFile()

OMV\System\IBlockDevice::getPreferredDeviceFile ( )

Get the device file to present in the UI, e.g.:

/dev/disk/by-id/xxx

  • /dev/disk/by-path/xxx
  • /dev/xxx
    Returns
    Returns a device file.

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

◆ getSectorSize()

OMV\System\IBlockDevice::getSectorSize ( )

Get the sectorsize of the device in bytes.

Returns
The sectorsize of the device in bytes.
Exceptions

Implemented in OMV\System\BlockDevice.

◆ getSize()

OMV\System\IBlockDevice::getSize ( )

Get the size of the device in bytes.

Returns
The size (64bit) of the device in bytes as string.
Exceptions

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

◆ hasDeviceFileById()

OMV\System\IBlockDevice::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.

Implemented in OMV\System\Filesystem\Filesystem, and OMV\System\BlockDevice.

◆ hasDeviceFileByPath()

OMV\System\IBlockDevice::hasDeviceFileByPath ( )

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

Returns
Returns TRUE if a disk/by-path device path exists, otherwise FALSE.

Implemented in OMV\System\BlockDevice.

◆ waitForDevice()

OMV\System\IBlockDevice::waitForDevice (   $timeout)

Wait for the specified device. If the device file is not available within the given time, then an exception is thrown.

Parameters
timeoutTimeout in seconds to wait for an available device.
Returns
None.
Exceptions

Implemented in OMV\System\BlockDevice.


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