openmediavault  4.0 (Arrakis)
The open network attached storage solution
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
OMV\System\Storage\StorageDevice Class Reference
Inheritance diagram for OMV\System\Storage\StorageDevice:
OMV\System\BlockDevice OMV\System\Storage\IStorageDevice OMV\System\IBlockDevice 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

 getModel ()
 
 getVendor ()
 
 getSerialNumber ()
 
 getDescription ()
 
 isRotational ()
 
 isRemovable ()
 
 isRaid ()
 
 isUsb ()
 
 isAta ()
 
 isReadOnly ()
 
 IsMediaAvailable ()
 
 hasSmartSupport ()
 
 assertHasSmartSupport ()
 
 wipe ()
 
- Public Member Functions inherited from OMV\System\BlockDevice
 __construct ($deviceFile)
 
 exists ()
 
 assertExists ()
 
 getDeviceFile ()
 
 getCanonicalDeviceFile ()
 
 getDeviceFileById ()
 
 hasDeviceFileById ()
 
 getDeviceFileByPath ()
 
 hasDeviceFileByPath ()
 
 getPredictableDeviceFile ()
 
 getPreferredDeviceFile ()
 
 getDeviceFileSymlinks ()
 
 getDeviceName ($canonical=FALSE)
 
 getSize ()
 
 getBlockSize ()
 
 getSectorSize ()
 
 getDeviceNumber ()
 
 getMajor ()
 
 getMinor ()
 
 getDescription ()
 
 hasUdevProperty ($id)
 
 assertUdevProperty ($id)
 
 getUdevProperty ($id)
 
 waitForDevice ($timeout)
 
- Public Member Functions inherited from OMV\System\Storage\IStorageDevice
 exists ()
 
 getDeviceFile ()
 
 getCanonicalDeviceFile ()
 
 getDeviceFileById ()
 
 hasDeviceFileById ()
 
 getDeviceFileSymlinks ()
 
 getDeviceName ($canonical=FALSE)
 
 getSize ()
 
 getBlockSize ()
 
 getSectorSize ()
 
 isMediaAvailable ()
 

Static Public Member Functions

static enumerate ($type=OMV_STORAGE_DEVICE_TYPE_ALL)
 
static enumerateUnused ($type=OMV_STORAGE_DEVICE_TYPE_ALL)
 
static enumerateUsed ($type=OMV_STORAGE_DEVICE_TYPE_ALL)
 
static isUsed ($deviceFile, $type=OMV_STORAGE_DEVICE_TYPE_ALL)
 
static getStorageDevice ($deviceFile)
 
static assertStorageDeviceExists ($deviceFile)
 

Protected Attributes

 $model = NULL
 
 $vendor = NULL
 
- Protected Attributes inherited from OMV\System\BlockDevice
 $deviceFile = NULL
 
 $deviceFileById = NULL
 
 $size = FALSE
 
 $blockSize = FALSE
 
 $sectorSize = FALSE
 
 $udevData = NULL
 

Additional Inherited Members

- Protected Member Functions inherited from OMV\System\BlockDevice
 getUdevData ($force=FALSE)
 

Member Function Documentation

◆ assertHasSmartSupport()

OMV\System\Storage\StorageDevice::assertHasSmartSupport ( )

Assert that the given device has S.M.A.R.T. support.

Returns
None.
Exceptions

◆ assertStorageDeviceExists()

static OMV\System\Storage\StorageDevice::assertStorageDeviceExists (   $deviceFile)
static

Assert that the object of the class which implements the given storage device exists.

Parameters
deviceFileSpecifies the device file, e.g.
/dev/sdb
  • /dev/md1
  • /dev/cciss/c0d0
  • /dev/disk/by-id/scsi-SATA_ST3200XXXX2AS_5XWXXXR6
  • /dev/disk/by-label/DATA
  • /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0
  • /dev/disk/by-uuid/ad3ee177-777c-4ad3-8353-9562f85c0895
Returns
None.
Exceptions

◆ enumerate()

static OMV\System\Storage\StorageDevice::enumerate (   $type = OMV_STORAGE_DEVICE_TYPE_ALL)
static

Enumerate devices matching the given storage device type.

Parameters
typeDefines the storage device type, e.g. hard disk, hard or Software RAID. Defaults to OMV_STORAGE_DEVICE_TYPE_ALL.
Returns
A list of devicefile names, otherwise FALSE.

◆ enumerateUnused()

static OMV\System\Storage\StorageDevice::enumerateUnused (   $type = OMV_STORAGE_DEVICE_TYPE_ALL)
static

Enumerate all unused devices. This list contains all devices of the given type except the devices that are used by other storage devices (e.g. LVM as physical volume or a member of a Software RAID).

Parameters
typeDefines the storage device type, e.g. hard disk, hard or Software RAID. Defaults to OMV_STORAGE_DEVICE_TYPE_ALL.
Returns
A list of devicefile names, otherwise FALSE.

◆ enumerateUsed()

static OMV\System\Storage\StorageDevice::enumerateUsed (   $type = OMV_STORAGE_DEVICE_TYPE_ALL)
static

Enumerate all used devices. The list contains all those devices that are used by the given storage devices, e.g. all members of a LVM or Software RAID.

Parameters
typeDefines the storage device type, e.g. hard disk, hard or Software RAID. Defaults to OMV_STORAGE_DEVICE_TYPE_ALL.
Returns
A list of devicefile names, otherwise FALSE.

◆ getDescription()

OMV\System\Storage\StorageDevice::getDescription ( )

See interface definition.

Implements OMV\System\Storage\IStorageDevice.

◆ getModel()

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

Get the device model.

Returns
The device model, otherwise an empty string.

Implements OMV\System\Storage\IStorageDevice.

◆ getSerialNumber()

OMV\System\Storage\StorageDevice::getSerialNumber ( )

Get the device serial number.

Returns
The device serial number, otherwise an empty string.

Implements OMV\System\Storage\IStorageDevice.

◆ getStorageDevice()

static OMV\System\Storage\StorageDevice::getStorageDevice (   $deviceFile)
static

Factory method to get the object of the class which implements the given storage device.

Parameters
deviceFileSpecifies the device file, e.g.
/dev/sdb
  • /dev/md1
  • /dev/cciss/c0d0
  • /dev/disk/by-id/scsi-SATA_ST3200XXXX2AS_5XWXXXR6
  • /dev/disk/by-label/DATA
  • /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0
  • /dev/disk/by-uuid/ad3ee177-777c-4ad3-8353-9562f85c0895
Returns
The object of the class implementing the given storage device, otherwise NULL.

◆ getVendor()

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

Get the device vendor.

Returns
The device vendor, otherwise an empty string.

Implements OMV\System\Storage\IStorageDevice.

◆ hasSmartSupport()

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

Implements OMV\System\Storage\IStorageDevice.

◆ isAta()

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

Check if the given device is connected via ATA.

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

Implements OMV\System\Storage\IStorageDevice.

◆ IsMediaAvailable()

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

◆ isRaid()

OMV\System\Storage\StorageDevice::isRaid ( )

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

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

Implements OMV\System\Storage\IStorageDevice.

◆ isReadOnly()

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

Check if the given device is read-only.

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

Implements OMV\System\Storage\IStorageDevice.

◆ isRemovable()

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

Check if the device is removable.

Returns
TRUE if device is removable, otherwise FALSE.

Implements OMV\System\Storage\IStorageDevice.

◆ isRotational()

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

Implements OMV\System\Storage\IStorageDevice.

◆ isUsb()

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

Check if the given device is an USB device.

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

Implements OMV\System\Storage\IStorageDevice.

◆ isUsed()

static OMV\System\Storage\StorageDevice::isUsed (   $deviceFile,
  $type = OMV_STORAGE_DEVICE_TYPE_ALL 
)
static

Check if the given device is used/consumed by another storage device.

Parameters
deviceFileSpecifies the device file, e.g.
/dev/sdb
  • /dev/md1
  • /dev/cciss/c0d0
  • /dev/disk/by-id/scsi-SATA_ST3200XXXX2AS_5XWXXXR6
  • /dev/disk/by-label/DATA
  • /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0
  • /dev/disk/by-uuid/ad3ee177-777c-4ad3-8353-9562f85c0895
typeDefines the storage device type, e.g. hard disk, hard or Software RAID. Defaults to OMV_STORAGE_DEVICE_TYPE_ALL.
Returns
TRUE if the given device is used/consumed by another storage device, otherwise FALSE.

◆ wipe()

OMV\System\Storage\StorageDevice::wipe ( )

Wipe the storage device.

Returns
None

Implements OMV\System\Storage\IStorageDevice.


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