mount

package module
v0.0.0-...-fb33415 Latest Latest
Warning

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

Go to latest
Published: May 24, 2014 License: Apache-2.0 Imports: 7 Imported by: 2

README

#mount

The mount package contains utilities for mounting Linux devices of the following types: tmpfs, hugetlbfs, btrfs and ext4.

It allows for the mounting of in-memory file systems of specific sizes and specified page sizes.

Build Status

Documentation

Overview

Package mount provides file system utiilty functions

Index

Constants

View Source
const (
	TMPFS_MAGIC       = 0x1021994
	HUGETLBFS_MAGIC   = 0x958458f6
	BTRFS_SUPER_MAGIC = 0x9123683e
	EXT4_SUPER_MAGIC  = 0xef53
)

Variables

This section is empty.

Functions

func InMountNamespace

func InMountNamespace() bool

func IsBtrfs

func IsBtrfs(path string) bool

Returns whether the path is a btrfs file system

func IsExt4

func IsExt4(path string) bool

Returns whether the path is an ext4 file system

func IsHugetlbfs

func IsHugetlbfs(path string) bool

Returns whether the path is a hugetlbfs file system

func IsMemoryFs

func IsMemoryFs(path string) bool

Returns whether the path is an in memory file system file system (either hugetlbfs or tmpfs)

func IsTmpfs

func IsTmpfs(path string) bool

Returns whether the path is a tmpfs file system

func MountExt4

func MountExt4(device, path string, readonly, sync bool) error

MountExt4 mounts the specifed ext4 volume device at the specified path The readonly flag allows the device to be mounted as read only The sync flag can be used to enforce synchronous device access

func MountHugetlbfs

func MountHugetlbfs(path string, pagesize int, size int64) error

MountTmpfs mounts a hugelbfs file system of the specified size with a specified page size at the provided path

func MountNamespace

func MountNamespace()

func MountTmpfs

func MountTmpfs(path string, size int64) error

MountTmpfs mounts a tmpfs file system of the specified size at the provided path

func RemountReadOnly

func RemountReadOnly(source, target string) error

RemountReadOnly remounts the specified source device at the target path as read only

Types

type Mount

type Mount struct {
	Device     string
	Path       string
	Filesystem string
	Flags      string
}

func Mounts

func Mounts() ([]Mount, error)

Jump to

Keyboard shortcuts

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