OpenMediaVault  3.0 (Erasmus)
The open network attached storage solution
Public Member Functions | Protected Member Functions | List of all members
OMV\System\Storage\Backend\BackendAbstract Class Reference
Inheritance diagram for OMV\System\Storage\Backend\BackendAbstract:
OMV\System\Storage\Backend\Bcache OMV\System\Storage\Backend\CCISS OMV\System\Storage\Backend\CDROM OMV\System\Storage\Backend\DM OMV\System\Storage\Backend\FIO OMV\System\Storage\Backend\HDD OMV\System\Storage\Backend\I2O OMV\System\Storage\Backend\Loop OMV\System\Storage\Backend\Mdadm OMV\System\Storage\Backend\MMC OMV\System\Storage\Backend\NVM OMV\System\Storage\Backend\RDB OMV\System\Storage\Backend\VirtIO

Public Member Functions

 getType ()
 
 enumerate ()
 
 enumerateSlaves ()
 
 isTypeOf ($deviceFile)
 
 getImpl ($args)
 
 baseDeviceFile ($deviceFile)
 
 fsDeviceFile ($deviceFile)
 

Protected Member Functions

 enumerateProcFs ($regex)
 
 isTypeOfByName ($deviceFile, $regex)
 

Detailed Description

The generic class that represents a storage device backend.

To implement a new storage backend the following information are necessary:

# cat /proc/partitions
# export LANG=C; blkid
# export LANG=C; udevadm info --query=property --name=/dev/<DEVNAME>
# cat /sys/block/<DEVNAME>/device/model
# cat /sys/block/<DEVNAME>/device/vendor

Member Function Documentation

OMV\System\Storage\Backend\BackendAbstract::baseDeviceFile (   $deviceFile)

Returns base device file by stripping the partition appendix.

Parameters
string$deviceFileSpecifies the device file, e.g.
/dev/sdb1 => /dev/sdb
  • /dev/cciss/c0d0p2 => /dev/cciss/c0d0
  • /dev/mapper/vg0-lv0 => /dev/mapper/vg0-lv0
  • /dev/dm-0 => /dev/dm-0
  • /dev/md0 => /dev/md0
  • /dev/loop0 => /dev/loop0
Returns
The base device file.
OMV\System\Storage\Backend\BackendAbstract::enumerate ( )
abstract

Get a list of devices of the given storage device backend.

Returns
A list of devicefile names, otherwise FALSE.
OMV\System\Storage\Backend\BackendAbstract::enumerateProcFs (   $regex)
finalprotected

Helper function to enumerate the devices represented by this storage device backend via the /proc filesystem.

Parameters
string$regexThe regular expression used to identify the devices represented by this storage backend.
Returns
A list of devicefile names, otherwise FALSE.
OMV\System\Storage\Backend\BackendAbstract::enumerateSlaves ( )

Get a list of all devices that are used by devices of this storage device backend.

Returns
A list of devicefile names, otherwise FALSE.
OMV\System\Storage\Backend\BackendAbstract::fsDeviceFile (   $deviceFile)

Return the device file to be used to create a filesystem.

Note
Only one partition per storage device is supported.
Parameters
string$deviceFileSpecifies the device file, e.g.
/dev/sdb => /dev/sdb1
  • /dev/cciss/c0d0 => /dev/cciss/c0d0p1
  • /dev/mapper/vg0-lv0 => /dev/mapper/vg0-lv0
  • /dev/dm-0 => /dev/dm-0
  • /dev/md0 => /dev/md0
Returns
The device file. Defaults to /dev/xxx1.
OMV\System\Storage\Backend\BackendAbstract::getImpl (   $args)

Get the object of the class that represents and implements a device of this storage device backend.

Parameters
string$argsThe arguments to the class constructor.
Returns
The object of the class implementing the given device type, otherwise NULL.
OMV\System\Storage\Backend\BackendAbstract::getType ( )
abstract

Get the type of the storage device backend, e.g. OMV_STORAGE_DEVICE_TYPE_HDD, OMV_STORAGE_DEVICE_TYPE_HBA, ...

OMV\System\Storage\Backend\BackendAbstract::isTypeOf (   $deviceFile)

Check whether the given device is represented by this storage device backend.

Parameters
string$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
TRUE if successful, otherwise FALSE.
OMV\System\Storage\Backend\BackendAbstract::isTypeOfByName (   $deviceFile,
  $regex 
)
finalprotected

Helper function to check whether the given device is represented by this storage device backend.

Parameters
string$deviceFileSpecifies the device file.
string$regexThe regular expression used to identify the devices represented by this storage backend.

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