fstab

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PassDoNotCheck      = 0
	PassCheckDuringBoot = 1
	PassCheckAfterBoot  = 2

	DefaultPath = "/etc/fstab"
)

Variables

View Source
var (
	ErrInvalidFSTabEntry                     = errors.New("invalid fstab entry")
	ErrDifferentFSTabEntryWithSameMountPoint = errors.New("a different fstab entry with the same mount point already exists")
)

Functions

This section is empty.

Types

type Entry

type Entry struct {
	// The device name, label, UUID, or other means of specifying the partition or data source this entry refers to.
	Source string

	// Where the contents of the device may be accessed after mounting
	MountPoint string

	// The type of file system to be mounted.
	FSType string

	// Options describing various other aspects of the file system, such as whether it is automatically mounted at boot, which users may mount or access it, whether it may be written to or only read from, its size, and so forth; the special option defaults refers to a pre-determined set of options depending on the file system type.
	Options string

	// A number indicating whether and how often the file system should be backed up by the dump program; a zero indicates the file system will never be automatically backed up.
	Dump int

	// A number indicating the order in which the fsck program will check the devices for errors at boot time
	Pass int
}

func (*Entry) String

func (e *Entry) String() string

type FStab

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

func Get

func Get() *FStab

func (*FStab) Add

func (f *FStab) Add(e Entry, replace bool) error

func (*FStab) GetEntries

func (f *FStab) GetEntries() ([]*Entry, error)

func (*FStab) GetEntryByMountPoint

func (f *FStab) GetEntryByMountPoint(mountpoint string) (*Entry, error)

func (*FStab) GetEntryBySource

func (f *FStab) GetEntryBySource(source string) (*Entry, error)

func (*FStab) RemoveByMountPoint

func (f *FStab) RemoveByMountPoint(mountpoint string, comment bool) error

Jump to

Keyboard shortcuts

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