openmediavault  4.0 (Arrakis)
The open network attached storage solution
Public Member Functions | Static Public Member Functions | List of all members
OMV\System\MountPoint Class Reference

Public Member Functions

 __construct ($dir)
 
 getPath ()
 
 setPath ($dir)
 
 exists ()
 
 create ($mode="0700")
 
 unlink ($force=TRUE)
 
 isMountPoint ()
 
 isMounted ()
 
 mount ($options="")
 
 umount ($force=FALSE, $lazy=FALSE)
 

Static Public Member Functions

static buildPath ($id)
 

Detailed Description

A class that implements a mountpoint.

Constructor & Destructor Documentation

◆ __construct()

OMV\System\MountPoint::__construct (   $dir)

Constructor

Parameters
dirPath to the directory, e.g.
/srv/78b669c1-9183-4ca3-a32c-80a4e2c61e2d (EXT2/3/4, JFS, XFS)
  • /srv/7A48-BA97 (FAT)
  • /srv/2ED43920D438EC29 (NTFS)

Member Function Documentation

◆ buildPath()

static OMV\System\MountPoint::buildPath (   $id)
static

Get the mountpoint path where the file system should be mounted to. Note, this path is OMV specific: /srv/<FSUUID>.

Parameters
idstring The device file or UUID of the file system, e.g.
78b669c1-9183-4ca3-a32c-80a4e2c61e2d (EXT2/3/4, JFS, XFS)
  • 7A48-BA97 (FAT)
  • 2ED43920D438EC29 (NTFS)
  • /dev/sda2
  • /dev/sdb
  • /dev/md1
  • /dev/disk/by-id/scsi-SATA_ST3200XXXX2AS_5XWXXXR6
  • /dev/disk/by-id/wwn-0x5000cca211cc703c-part1
  • /dev/disk/by-id/md-name-vmpc01:data
  • /dev/disk/by-id/md-uuid-75de9de9:6beca92e:8442575c:73eabbc9
  • /dev/disk/by-label/xx
Returns
The path where to mount the file system, e.g. /srv/85732966-949a-4d8b-87d7-d7e6681f787e or /srv/dev-disk-by-id-wwn-0x5000cca211cc703c-part1 or /srv/dev-disk-by-id-md-name-vmpc01-data.

◆ create()

OMV\System\MountPoint::create (   $mode = "0700")

Create the mountpoint of the file system.

Parameters
modeSet the file mode (as in chmod), e.g. '0755'. Defaults to '0700'.
Returns
None.
Exceptions

◆ exists()

OMV\System\MountPoint::exists ( )

Check whether the directory exists.

Returns
Returns TRUE if the directory exists, otherwise FALSE.

◆ getPath()

OMV\System\MountPoint::getPath ( )

Get the directory path.

Returns
The directory path.

◆ isMounted()

OMV\System\MountPoint::isMounted ( )

Check if the associated mountpoint is mounted.

Returns
TRUE if the mountpoint is mounted, otherwise FALSE.
Exceptions

◆ isMountPoint()

OMV\System\MountPoint::isMountPoint ( )

See if the directory is a mountpoint.

Returns
TRUE if the directory is a mountpoint, FALSE if not.
Exceptions

◆ mount()

OMV\System\MountPoint::mount (   $options = "")

Mount the this mountpoint.

Parameters
optionsAn array or comma seperated string of additional mount options. Defaults to "".
Returns
None.
Exceptions

◆ setPath()

OMV\System\MountPoint::setPath (   $dir)

Set the directory path, e.g.

/srv/78b669c1-9183-4ca3-a32c-80a4e2c61e2d (EXT2/3/4, JFS, XFS)

  • /srv/7A48-BA97 (FAT)
  • /srv/2ED43920D438EC29 (NTFS)
    Returns
    None.

◆ umount()

OMV\System\MountPoint::umount (   $force = FALSE,
  $lazy = FALSE 
)

Unmount the this mountpoint.

Parameters
forceSet to TRUE to force unmount. Defaults to FALSE.
lazySet to TRUE to lazy unmount. Defaults to FALSE.
Returns
None.
Exceptions

◆ unlink()

OMV\System\MountPoint::unlink (   $force = TRUE)

Unlink the mountpoint of the file system.

Parameters
forceSet to TRUE to ignore nonexistent files. Defaults to TRUE.
Returns
None.
Exceptions

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