OpenMediaVault  0.6 (Kralizec)
The open network attached storage solution
 All Classes Functions Variables Groups Pages
Public Member Functions | Protected Member Functions | List of all members
OMVStorageDeviceBackendAbstract Class Reference
Inheritance diagram for OMVStorageDeviceBackendAbstract:
OMVObject OMVStorageDeviceBackendBcache OMVStorageDeviceBackendCCISS OMVStorageDeviceBackendDM OMVStorageDeviceBackendHDD OMVStorageDeviceBackendLoop OMVStorageDeviceBackendMdadm OMVStorageDeviceBackendLVM

Public Member Functions

 getType ()
 
 enumerate ()
 
 enumerateSlaves ()
 
 isTypeOf ($deviceFile)
 
 getImpl ($args)
 
 baseDeviceFile ($deviceFile)
 
 fsDeviceFile ($deviceFile)
 
- Public Member Functions inherited from OMVObject
 __construct ()
 
 getLastError ()
 

Protected Member Functions

 enumerateProcFs ($regex)
 
 isTypeOfByName ($deviceFile, $regex)
 
- Protected Member Functions inherited from OMVObject
 setLastError ($error)
 
 debug ()
 

Detailed Description

The generic class that represents a storage device backend.

Member Function Documentation

OMVStorageDeviceBackendAbstract::baseDeviceFile (   $deviceFile)

Returns base device file by stripping the partition appendix.

Parameters
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.
OMVStorageDeviceBackendAbstract::enumerate ( )
abstract

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

Returns
A list of devicefile names, otherwise FALSE.
OMVStorageDeviceBackendAbstract::enumerateProcFs (   $regex)
finalprotected

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

Parameters
regexThe regular expression used to identify the devices represented by this storage backend.
Returns
A list of devicefile names, otherwise FALSE.
OMVStorageDeviceBackendAbstract::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.
OMVStorageDeviceBackendAbstract::fsDeviceFile (   $deviceFile)

Return the device file to be used to create a filesystem. Note, only one partition per storage device is supported.

Parameters
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.
OMVStorageDeviceBackendAbstract::getImpl (   $args)

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

Parameters
argsThe arguments to the class constructor.
Returns
The object of the class implementing the given device type, otherwise NULL.
OMVStorageDeviceBackendAbstract::getType ( )
abstract

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

OMVStorageDeviceBackendAbstract::isTypeOf (   $deviceFile)

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

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
TRUE if successful, otherwise FALSE.
OMVStorageDeviceBackendAbstract::isTypeOfByName (   $deviceFile,
  $regex 
)
finalprotected

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

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

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