mount

package
v1.2.0-RC1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// HostMountsFilePath is the default path of
	// the mounts file mounted inside container
	HostMountsFilePath = "/host/proc/1/mounts"
)

Variables

View Source
var ErrCouldNotFindRootDevice = fmt.Errorf("could not find root device")

Functions

This section is empty.

Types

type DeviceMountAttr

type DeviceMountAttr struct {
	DevPath    string // DevPath of the device/block
	MountPoint string // MountPoint of the the device/block
	FileSystem string // FileSystem in the device that is mounted
}

DeviceMountAttr is the struct used for returning all available mount related information like mount point, filesystem type etc. It helps to find mountpoint of a partition/block

type DiskMountUtil

type DiskMountUtil struct {
	// contains filtered or unexported fields
}

DiskMountUtil contains the mountfile path, devpath/mountpoint which can be used to detect partition of a mountpoint or mountpoint of a partition.

func NewMountUtil

func NewMountUtil(filePath, devPath, mountPoint string) DiskMountUtil

NewMountUtil returns DiskMountUtil struct for given mounts file path and mount point

func (DiskMountUtil) GetDiskPath

func (m DiskMountUtil) GetDiskPath() (string, error)

GetDiskPath returns os disk devpath

type Identifier

type Identifier struct {
	DevPath string
}

Identifier is an identifier for the mount probe. It will be a devpath like /dev/sda, /dev/sda1 etc

func (*Identifier) DeviceBasicMountInfo

func (I *Identifier) DeviceBasicMountInfo(mountsFilePath string) (DeviceMountAttr, error)

DeviceBasicMountInfo gives the mount attributes of a device that is attached. The mount attributes include the filesystem type, mountpoint, device path etc. These mount attributes are fetched by parsing a mounts file (/proc/1/mounts) and getting the relevant data. If the device is not mounted, then the function will return an error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL