OpenMediaVault  0.6 (Kralizec)
The open network attached storage solution
 All Classes Functions Variables Groups Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
OMVFilesystemAbstract Class Reference
Inheritance diagram for OMVFilesystemAbstract:
OMVObject OMVFilesystem

Public Member Functions

 __construct ($id)
 
 refresh ()
 
 exists ()
 
 hasUuid ()
 
 getUuid ()
 
 hasLabel ()
 
 getLabel ()
 
 getType ()
 
 getPartitionType ()
 
 getPartitionScheme ()
 
 getUsage ()
 
 getPartitionEntry ()
 
 getDeviceFile ()
 
 getCanonicalDeviceFile ()
 
 getDeviceFileByUuid ()
 
 getStorageDeviceFile ()
 
 getBlockSize ()
 
 getMountPoint ()
 
 getStatistics ()
 
 hasPosixAclSupport ()
 
 isMounted ()
 
 mount ($options="")
 
 umount ($force=FALSE, $lazy=FALSE)
 
- Public Member Functions inherited from OMVObject
 __construct ()
 
 getLastError ()
 

Static Public Member Functions

static isMountPoint ($dir)
 
static buildMountPath ($uuid)
 
static hasFileSystem ($deviceFile)
 

Protected Attributes

 $uuid = ""
 
 $type = ""
 
 $deviceFile = ""
 
 $label = ""
 
 $partEntry = NULL
 
 $usage = ""
 

Additional Inherited Members

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

Detailed Description

Abstract class implementing generic filesystems.

Constructor & Destructor Documentation

OMVFilesystemAbstract::__construct (   $id)

Constructor

Parameters
idThe UUID or device path of the filesystem, e.g.
78b669c1-9183-4ca3-a32c-80a4e2c61e2d (EXT2/3/4, JFS, XFS)
  • 7A48-BA97 (DOS)
  • 2ED43920D438EC29 (NTFS)
  • /dev/sde1
  • /dev/disk/by-id/scsi-SATA_ST3200XXXX2AS_5XWXXXR6-part1
  • /dev/disk/by-label/DATA
  • /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0-part2
  • /dev/disk/by-uuid/ad3ee177-777c-4ad3-8353-9562f85c0895
  • /dev/cciss/c0d0p2

Member Function Documentation

static OMVFilesystemAbstract::buildMountPath (   $uuid)
static

Get the directory where the filesystem should be mounted to. Note, this path is OMV specific: /media/<FSUUID>.

Parameters
uuidThe UUID of the filesystem.
Returns
The path where to mount the filesystem, e.g. /media/85732966-949a-4d8b-87d7-d7e6681f787e.
OMVFilesystemAbstract::exists ( )

Checks if the filesystem exists.

Returns
TRUE if the device exists, otherwise FALSE.
OMVFilesystemAbstract::getBlockSize ( )

Get the filesystem block size.

Returns
The block size, otherwise FALSE.
OMVFilesystemAbstract::getCanonicalDeviceFile ( )

Get the canonical device file, e.g. /dev/root -> /dev/sde1

OMVFilesystemAbstract::getDeviceFile ( )

Get the device path of the filesystem, e.g /dev/sdb1.

Returns
The device name, otherwise FALSE.
OMVFilesystemAbstract::getDeviceFileByUuid ( )

Get the device path by UUID, e.g.

  • /dev/disk/by-uuid/ad3ee177-777c-4ad3-8353-9562f85c0895
  • /dev/disk/by-uuid/2ED43920D438EC29 (NTFS)
    Returns
    The device path (/dev/disk/by-uuid/xxx) if available, otherwise /dev/xxx will be returned. In case of an error FALSE will be returned.
OMVFilesystemAbstract::getLabel ( )

Get the filesystem label.

Returns
The filesystem label, otherwise FALSE.
OMVFilesystemAbstract::getMountPoint ( )

Get the mount point of the given filesystem.

Returns
The mountpoint of the filesystem or FALSE.
OMVFilesystemAbstract::getPartitionEntry ( )

Get the partition entry information.

Returns
An array with the fields scheme, uuid, type, flags, number, offset, size and disk, otherwise FALSE.
OMVFilesystemAbstract::getPartitionScheme ( )

Get the partition scheme, e.g. 'gpt', 'mbr', 'apm' or 'dos'.

Returns
The filesystem type, otherwise FALSE.
OMVFilesystemAbstract::getPartitionType ( )

Get the partition scheme, e.g. 'gpt', 'mbr', 'apm' or 'dos'.

Deprecated:
Returns
The filesystem type, otherwise FALSE.
OMVFilesystemAbstract::getStatistics ( )

Get statistics from a mounted filesystem.

Returns
The filesystem statistics if successful, otherwise FALSE. The following fields are included: devicefile, type, blocks, size, used, available, percentage and mountpoint. Please note, the fields size, used and available are strings and their unit is 'B' (bytes).
OMVFilesystemAbstract::getStorageDeviceFile ( )

Get the device file of the storage device containing this file system. Example:

/dev/sdb1 => /dev/sdb

  • /dev/cciss/c0d0p2 => /dev/cciss/c0d0
    Returns
    The device file of the underlying storage device, otherwise FALSE.
OMVFilesystemAbstract::getType ( )

Get the filesystem type, e.g. 'ext3' or 'vfat'.

Returns
The filesystem type, otherwise FALSE.
OMVFilesystemAbstract::getUsage ( )

Get the usage, e.g. 'other' or 'filesystem'.

Returns
The filesystem type, otherwise FALSE.
OMVFilesystemAbstract::getUuid ( )

Get the UUID of the filesystem.

Returns
The UUID of the filesystem, otherwise FALSE.
static OMVFilesystemAbstract::hasFileSystem (   $deviceFile)
static

Check if the given device file contains a file system.

Parameters
deviceFileThe devicefile to check.
Returns
TRUE if the devicefile has a file system, otherwise FALSE.
OMVFilesystemAbstract::hasLabel ( )

Check if the filesystem has a label.

Returns
Returns TRUE if the filesystem has a label, otherwise FALSE.
OMVFilesystemAbstract::hasPosixAclSupport ( )

Does the filesystem support POSIX ACL.

Returns
TRUE if the filesystem supports POSIX ACL, otherwise FALSE.
OMVFilesystemAbstract::hasUuid ( )

Check if the filesystem has an UUID.

Returns
Returns TRUE if the filesystem has an UUID, otherwise FALSE.
OMVFilesystemAbstract::isMounted ( )

Check if a filesystem is mounted.

Returns
TRUE if the filesystem is mounted, otherwise FALSE.
static OMVFilesystemAbstract::isMountPoint (   $dir)
static

See if a directory is a mountpoint.

Parameters
@returnTRUE if the directory is a mountpoint, otherwise FALSE.
OMVFilesystemAbstract::mount (   $options = "")

Mount the filesystem by its device file or UUID.

Parameters
optionsAdditional mount options. Defaults to "".
Returns
TRUE if successful, otherwise FALSE.
OMVFilesystemAbstract::refresh ( )

Refresh the cached information.

Returns
TRUE if successful, otherwise FALSE.
OMVFilesystemAbstract::umount (   $force = FALSE,
  $lazy = FALSE 
)

Unmount the filesystem.

Parameters
forceSet to TRUE to force unmount. Defaults to FALSE.
lazySet to TRUE to lazy unmount. Defaults to FALSE.
Returns
TRUE if successful, otherwise FALSE.

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