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\Lvm\PhysicalVolume Class Reference

Public Member Functions

 __construct ($deviceFile)
 
 refresh ()
 
 exists ()
 
 assertExists ()
 
 getDeviceFile ()
 
 getCanonicalDeviceFile ()
 
 getPreferredDeviceFile ()
 
 getUuid ()
 
 getSize ()
 
 getFree ()
 
 getUsed ()
 
 getAllocatedPhysicalExtents ()
 
 getVGName ()
 
 getVGUuid ()
 
 getDescription ()
 
 create ()
 
 remove ()
 
 resize ()
 

Static Public Member Functions

static enumerate ()
 

Protected Attributes

 $deviceFile = ""
 
 $uuid = ""
 
 $size = ""
 
 $free = ""
 
 $used = ""
 
 $vgUuid = ""
 
 $vgName = ""
 
 $allocatedPE = 0
 

Detailed Description

Class to handle a LVM physical volume.

Constructor & Destructor Documentation

◆ __construct()

OMV\System\Storage\Lvm\PhysicalVolume::__construct (   $deviceFile)

Constructor

Parameters
string$deviceFileThe device file, e.g. /dev/sdb.

Member Function Documentation

◆ assertExists()

OMV\System\Storage\Lvm\PhysicalVolume::assertExists ( )

Assert that the volume group exists.

Returns
None.
Exceptions

◆ create()

OMV\System\Storage\Lvm\PhysicalVolume::create ( )

Create the physical volume.

Returns
None.
Exceptions

◆ enumerate()

static OMV\System\Storage\Lvm\PhysicalVolume::enumerate ( )
static

Enumerate LVM physical volumes.

Returns
A list of LVM physical volumes. Example: array( 0 => /dev/sdb 1 => /dev/sdd )
Exceptions

◆ exists()

OMV\System\Storage\Lvm\PhysicalVolume::exists ( )

Checks if the physical volume exists.

Returns
TRUE if the physical volume exists, otherwise FALSE.

◆ getAllocatedPhysicalExtents()

OMV\System\Storage\Lvm\PhysicalVolume::getAllocatedPhysicalExtents ( )

Get total number of allocated physical extents.

Returns
The total number of allocated physical extents.

◆ getCanonicalDeviceFile()

OMV\System\Storage\Lvm\PhysicalVolume::getCanonicalDeviceFile ( )

Get the canonical device file, e.g.

/dev/mapper/vg0-lv0 -> /dev/dm-0

Returns
Returns the canonical device file.

◆ getDescription()

OMV\System\Storage\Lvm\PhysicalVolume::getDescription ( )

Get the description of the physical volume.

Returns
The physical volume description.

◆ getDeviceFile()

OMV\System\Storage\Lvm\PhysicalVolume::getDeviceFile ( )

Get the device path, e.g. /dev/vg0/lvol0.

Returns
The device path.

◆ getFree()

OMV\System\Storage\Lvm\PhysicalVolume::getFree ( )

Get the total amount of unallocated space.

Returns
The total amount of unallocated space in bytes as string.

◆ getPreferredDeviceFile()

OMV\System\Storage\Lvm\PhysicalVolume::getPreferredDeviceFile ( )

Get the device file to present in the UI, e.g.:

/dev/disk/by-id/xxx

  • /dev/disk/by-path/xxx
  • /dev/xxx
    Returns
    Returns a device file.

◆ getSize()

OMV\System\Storage\Lvm\PhysicalVolume::getSize ( )

Get the size of the physical volume in bytes.

Returns
The size of the physical volume in bytes as string.

◆ getUsed()

OMV\System\Storage\Lvm\PhysicalVolume::getUsed ( )

Get the total amount of allocated space.

Returns
The total amount of allocated space in bytes as string.

◆ getUuid()

OMV\System\Storage\Lvm\PhysicalVolume::getUuid ( )

Get the UUID of the physical volume.

Returns
The UUID of the physical volume.

◆ getVGName()

OMV\System\Storage\Lvm\PhysicalVolume::getVGName ( )

Get the name of the volume group the physical volume is assigned to.

Returns
The volume group name.

◆ getVGUuid()

OMV\System\Storage\Lvm\PhysicalVolume::getVGUuid ( )

Get the UUID of the volume group the physical volume is assigned to.

Returns
The volume group UUID.

◆ refresh()

OMV\System\Storage\Lvm\PhysicalVolume::refresh ( )

Refresh the cached informations.

Returns
None.

◆ remove()

OMV\System\Storage\Lvm\PhysicalVolume::remove ( )

Remove the physical volume.

Returns
None.
Exceptions

◆ resize()

OMV\System\Storage\Lvm\PhysicalVolume::resize ( )

Resize the physical volume.

Returns
None.
Exceptions

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