OpenMediaVault  0.6 (Kralizec)
The open network attached storage solution
 All Classes Functions Variables Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OMVStorageDeviceAbstract Class Reference
Inheritance diagram for OMVStorageDeviceAbstract:
OMVBlockDeviceAbstract OMVObject OMVIBlockDevice OMVStorageDeviceBcache OMVStorageDeviceDM OMVStorageDeviceLoop OMVStorageDeviceMdadm OMVStorageDeviceSMARTAbstract OMVLvmLogicalVolume OMVStorageDeviceCCISS OMVStorageDeviceHDD

Public Member Functions

 __construct ($deviceFile)
 
 exists ()
 
 getDeviceFile ()
 
 getDeviceFileById ()
 
 getSize ()
 
 getBlockSize ()
 
 getSectorSize ()
 
 getModel ()
 
 getVendor ()
 
 getSerialNumber ()
 
 getDescription ()
 
 isRotational ()
 
 isRaid ()
 
 isUsb ()
 
 isAta ()
 
 hasSMART ()
 
- Public Member Functions inherited from OMVBlockDeviceAbstract
 __construct ($deviceFile)
 
 exists ()
 
 getDeviceFile ()
 
 getCanonicalDeviceFile ()
 
 getDeviceName ($canonical=FALSE)
 
 getSize ()
 
 getBlockSize ()
 
 getSectorSize ()
 
 getDeviceNumber ()
 
 getMajor ()
 
 getMinor ()
 
- Public Member Functions inherited from OMVObject
 __construct ()
 
 getLastError ()
 

Protected Member Functions

 getUdevProperty ($id)
 
- Protected Member Functions inherited from OMVObject
 setLastError ($error)
 
 debug ()
 

Protected Attributes

 $deviceFileById = FALSE
 
 $model = FALSE
 
 $vendor = FALSE
 
 $udevInfo = FALSE
 
- Protected Attributes inherited from OMVBlockDeviceAbstract
 $deviceFile = FALSE
 
 $size = FALSE
 
 $blockSize = FALSE
 
 $sectorSize = FALSE
 

Detailed Description

Abstract class implementing generic storage devices.

Constructor & Destructor Documentation

OMVStorageDeviceAbstract::__construct (   $deviceFile)

Constructor

Parameters
deviceFileThe device file, e.g. /dev/sdb or /dev/md1 or /dev/disk/by-id/scsi-SATA_ST3200XXXX2AS_5XWXXXR6.

Member Function Documentation

OMVStorageDeviceAbstract::exists ( )

See interface definition.

Implements OMVIBlockDevice.

OMVStorageDeviceAbstract::getBlockSize ( )

Get the blocksize of the device in bytes.

Returns
The blocksize of the device in bytes, otherwise FALSE.

Implements OMVIBlockDevice.

OMVStorageDeviceAbstract::getDescription ( )

See interface definition.

Implements OMVIBlockDevice.

OMVStorageDeviceAbstract::getDeviceFile ( )

See interface definition.

Implements OMVIBlockDevice.

OMVStorageDeviceAbstract::getDeviceFileById ( )

Get the device path 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
    Returns
    The device path (/dev/disk/by-id/xxx) if available, otherwise /dev/xxx will be returned. In case of an error FALSE will be returned.
OMVStorageDeviceAbstract::getModel ( )

Get the device model.

Returns
The device model, otherwise an empty string.
OMVStorageDeviceAbstract::getSectorSize ( )

Get the sectorsize of the device in bytes.

Returns
The sectorsize of the device in bytes, otherwise FALSE.

Implements OMVIBlockDevice.

OMVStorageDeviceAbstract::getSerialNumber ( )

Get the device serial number.

Returns
The device serial number, otherwise an empty string.
OMVStorageDeviceAbstract::getSize ( )

Get the size of the device in bytes.

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

Implements OMVIBlockDevice.

OMVStorageDeviceAbstract::getUdevProperty (   $id)
protected

Queries the udev database for device information stored in the udev database.

Parameters
idThe name of the property, e.g. ID_VENDOR, ID_MODEL or ID_SERIAL_SHORT.
Returns
The requested property, otherwise FALSE.
OMVStorageDeviceAbstract::getVendor ( )

Get the device vendor.

Returns
The device vendor, otherwise an empty string.
OMVStorageDeviceAbstract::hasSMART ( )

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

Returns
TRUE if the device supports S.M.A.R.T., otherwise FALSE.
OMVStorageDeviceAbstract::isAta ( )

Check if the given device is connected via ATA.

Returns
TRUE if the device is connected via ATA, otherwise FALSE.
OMVStorageDeviceAbstract::isRaid ( )

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

Returns
TRUE if the device is a hardware/software RAID, otherwise FALSE.
OMVStorageDeviceAbstract::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.
OMVStorageDeviceAbstract::isUsb ( )

Check if the given device is an USB device.

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

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