mount

package
v0.0.0-...-3bfe646 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Service

func Service(config ServiceConfig, service string, services systemservice.ServiceManager) error

Service creates a new mount based on the given configuration. The mount is created as a systemd mount unit named service.

func UnmountService

func UnmountService(service string, services systemservice.ServiceManager) error

UnmountService uninstalls the specified mount service.

Types

type Mounter

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

Mounter is a directory mounter

func NewMounter

func NewMounter(rootDir string) *Mounter

NewMounter creates a new Mounter for the specified root directory

func (*Mounter) BindMount

func (r *Mounter) BindMount(hostDir, localDir string) error

BindMount bind-mounts the specified hostDir. After chroot(r.rootDir), hostDir will be available as localDir inside the new environment

func (*Mounter) RoBindMount

func (r *Mounter) RoBindMount(hostDir, localDir string) error

RoBindMount bind-mounts the specified hostDir in read-only mode. After chroot(r.rootDir), hostDir will be available as localDir inside the new environment

func (*Mounter) Unmount

func (r *Mounter) Unmount(localDir string) error

Unmount unmounts the specified directory localDir. localDir is assumed to be relative to r.rootDir

type ServiceConfig

type ServiceConfig struct {
	// What specifies defines the absolute path of a device node, file or other resource to mount
	What storage.DeviceName
	// Where specifies the absolute path of a directory for the mount point
	Where string
	// Filesystem specifies the file system type
	Filesystem string
	// Options lists mount options to use when mounting
	Options []string
}

ServiceConfig describes configuration to mount a directory on a specific device and filesystem

See https://www.freedesktop.org/software/systemd/man/systemd.mount.html

Jump to

Keyboard shortcuts

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