openmediavault
4.0 (Arrakis)
The open network attached storage solution
|
Public Member Functions | |
__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) | |
Protected Member Functions | |
getUdevData ($force=FALSE) | |
Protected Attributes | |
$deviceFile = NULL | |
$deviceFileById = NULL | |
$size = FALSE | |
$blockSize = FALSE | |
$sectorSize = FALSE | |
$udevData = NULL | |
This class implements an interface to a generic Linux block device.
OMV\System\BlockDevice::__construct | ( | $deviceFile | ) |
Constructor
deviceFile | The device file, e.g.
|
OMV\System\BlockDevice::assertExists | ( | ) |
Assert that the device exists.
OMV\System\BlockDevice::assertUdevProperty | ( | $id | ) |
Assert that a udev property exists.
id | The name of the property, e.g. ID_VENDOR, ID_MODEL or ID_SERIAL_SHORT. |
OMV\System\BlockDevice::exists | ( | ) |
See interface definition.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getBlockSize | ( | ) |
Get the blocksize of the device in bytes.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getCanonicalDeviceFile | ( | ) |
See interface definition.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getDescription | ( | ) |
See interface definition.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getDeviceFile | ( | ) |
See interface definition.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getDeviceFileById | ( | ) |
See interface definition.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getDeviceFileByPath | ( | ) |
Get the device file by PATH, e.g.
/dev/disk/by-path/pci-0000:00:17.0-ata-3
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getDeviceFileSymlinks | ( | ) |
See interface definition.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getDeviceName | ( | $canonical = FALSE | ) |
See interface definition.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getDeviceNumber | ( | ) |
See interface definition.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getMajor | ( | ) |
See interface definition.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getMinor | ( | ) |
See interface definition.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getPredictableDeviceFile | ( | ) |
Get a predictable device file in the following order:
/dev/disk/by-id/xxx
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getPreferredDeviceFile | ( | ) |
Get the device file to present in the UI, e.g.:
/dev/disk/by-id/xxx
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getSectorSize | ( | ) |
Get the sectorsize of the device in bytes.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::getSize | ( | ) |
Get the size of the device in bytes.
Implements OMV\System\IBlockDevice.
|
protected |
Queries the udev database for device information stored in the udev database.
force | Force the collection of the information, even when the information is already cached. Defaults to FALSE. |
OMV\System\BlockDevice::getUdevProperty | ( | $id | ) |
Queries the udev database for device information stored in the udev database.
id | The name of the property, e.g. ID_VENDOR, ID_MODEL or ID_SERIAL_SHORT. |
OMV\System\BlockDevice::hasDeviceFileById | ( | ) |
Check whether the device has a /dev/disk/by-id/xxx device path.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::hasDeviceFileByPath | ( | ) |
Check whether the device has a /dev/disk/by-path/xxx device path.
Implements OMV\System\IBlockDevice.
OMV\System\BlockDevice::hasUdevProperty | ( | $id | ) |
Checks if a udev property exists.
id | The name of the property, e.g. ID_VENDOR, ID_MODEL or ID_SERIAL_SHORT. |
OMV\System\BlockDevice::waitForDevice | ( | $timeout | ) |
Wait for the specified device. If the device file is not available within the given time, then an exception is thrown.
timeout | Timeout in seconds to wait for an available device. |
Implements OMV\System\IBlockDevice.