Documentation ¶
Overview ¶
Package gofsutil provides many filesystem-specific functions, such as mount, format, etc., and is based largely on k8s.io/pkg/util/mount.
Index ¶
- Constants
- Variables
- func BindMount(ctx context.Context, source, target string, opts ...string) error
- func DeviceRescan(ctx context.Context, devicePath string) error
- func EvalSymlinks(_ context.Context, symPath *string) error
- func FindFSType(ctx context.Context, mountpoint string) (fsType string, err error)
- func Format(ctx context.Context, source, target, fsType string, opts ...string) error
- func FormatAndMount(ctx context.Context, source, target, fsType string, opts ...string) error
- func FsInfo(ctx context.Context, path string) (int64, int64, int64, int64, int64, int64, error)
- func GetDiskFormat(ctx context.Context, disk string) (string, error)
- func GetFCHostPortWWNs(ctx context.Context) ([]string, error)
- func GetMpathNameFromDevice(ctx context.Context, device string) (string, error)
- func GetSysBlockDevicesForVolumeWWN(ctx context.Context, volumeWWN string) ([]string, error)
- func IssueLIPToAllFCHosts(ctx context.Context) error
- func MakeMountArgs(_ context.Context, source, target, fsType string, opts ...string) []string
- func Mount(ctx context.Context, source, target, fsType string, opts ...string) error
- func MultipathCommand(ctx context.Context, timeoutSeconds time.Duration, chroot string, ...) ([]byte, error)
- func RemoveBlockDevice(ctx context.Context, blockDevicePath string) error
- func RemoveDuplicates(a []string) []string
- func RemoveDuplicatesExponentialOrdered(a []string) []string
- func RemoveDuplicatesExponentialUnordered(a []string) []string
- func RemoveDuplicatesLinearOrdered(a []string) []string
- func RescanSCSIHost(ctx context.Context, targets []string, lun string) error
- func ResizeFS(ctx context.Context, ...) error
- func ResizeMultipath(ctx context.Context, deviceName string) error
- func TargetIPLUNToDevicePath(ctx context.Context, targetIP string, lunID int) (map[string]string, error)
- func Unmount(ctx context.Context, target string) error
- func UseMockFS()
- func ValidateDevice(ctx context.Context, source string) (string, error)
- func WWNToDevicePath(ctx context.Context, wwn string) (string, error)
- func WWNToDevicePathX(ctx context.Context, wwn string) (string, string, error)
- type ContextKey
- type DeviceMountInfo
- type Entry
- type EntryScanFunc
- type FS
- func (fs *FS) BindMount(ctx context.Context, source, target string, options ...string) error
- func (fs *FS) DeviceRescan(ctx context.Context, devicePath string) error
- func (fs *FS) FindFSType(ctx context.Context, mountpoint string) (fsType string, err error)
- func (fs *FS) Format(ctx context.Context, source, target, fsType string, options ...string) error
- func (fs *FS) FormatAndMount(ctx context.Context, source, target, fsType string, options ...string) error
- func (fs *FS) FsInfo(ctx context.Context, path string) (int64, int64, int64, int64, int64, int64, error)
- func (fs *FS) GetDevMounts(ctx context.Context, dev string) ([]Info, error)
- func (fs *FS) GetDiskFormat(ctx context.Context, disk string) (string, error)
- func (fs *FS) GetFCHostPortWWNs(ctx context.Context) ([]string, error)
- func (fs *FS) GetMountInfoFromDevice(ctx context.Context, devID string) (*DeviceMountInfo, error)
- func (fs *FS) GetMounts(ctx context.Context) ([]Info, error)
- func (fs *FS) GetMpathNameFromDevice(ctx context.Context, device string) (string, error)
- func (fs *FS) GetSysBlockDevicesForVolumeWWN(ctx context.Context, volumeWWN string) ([]string, error)
- func (fs *FS) IssueLIPToAllFCHosts(ctx context.Context) error
- func (fs *FS) Mount(ctx context.Context, source, target, fsType string, options ...string) error
- func (fs *FS) MultipathCommand(ctx context.Context, timeoutSeconds time.Duration, chroot string, ...) ([]byte, error)
- func (fs *FS) RemoveBlockDevice(ctx context.Context, blockDevicePath string) error
- func (fs *FS) RescanSCSIHost(ctx context.Context, targets []string, lun string) error
- func (fs *FS) ResizeFS(ctx context.Context, ...) error
- func (fs *FS) ResizeMultipath(ctx context.Context, deviceName string) error
- func (fs *FS) TargetIPLUNToDevicePath(ctx context.Context, targetIP string, lunID int) (map[string]string, error)
- func (fs *FS) Unmount(ctx context.Context, target string) error
- func (fs *FS) ValidateDevice(ctx context.Context, source string) (string, error)
- func (fs *FS) WWNToDevicePath(ctx context.Context, wwn string) (string, string, error)
- type FSinterface
- type Info
Constants ¶
const FCPortPrefix = "0x50"
FCPortPrefix has the required port prefix for FCTargetHosts
const NoDiscard = "NoDiscard"
NoDiscard is a context option for using the nodiscard flag on mkfs
const ProcMountsFields = 9
ProcMountsFields is fields per line in procMountsPath as per https://www.kernel.org/doc/Documentation/filesystems/proc.txt
const RequestID = "RequestID"
RequestID is for logging the CSI or other type of Request ID
Variables ¶
var ( // GOFSMockMounts and the other variables in gofsutils_mock.go // allow the user to manipulate the data returned in the mock // mode or return induced errors. GOFSMockMounts []Info // GOFSMockFCHostWWNs is a list of port WWNs on this host's FC NICs GOFSMockFCHostWWNs []string // GOFSMockWWNToDevice allows you to return a device for a WWN. GOFSMockWWNToDevice map[string]string // GOFSWWNPath gives a path for the WWN entry (e.g. /dev/disk/by-id/wwn-0x) GOFSWWNPath string // GOFSMockTargetIPLUNToDevice map[string]string // assumes key is of form ip-<targetIP>:-lun<decimal_lun_id> GOFSMockTargetIPLUNToDevice map[string]string // GOFSRescanCallback is a function called when a rescan is processed. GOFSRescanCallback func(scan string) // GOFSMockMountInfo contains mount information for filesystem volumes GOFSMockMountInfo *DeviceMountInfo // GOFSMock allows you to induce errors in the various routine. GOFSMock struct { InduceBindMountError bool InduceMountError bool InduceGetMountsError bool InduceDevMountsError bool InduceUnmountError bool InduceFormatError bool InduceGetDiskFormatError bool InduceWWNToDevicePathError bool InduceTargetIPLUNToDeviceError bool InduceRemoveBlockDeviceError bool InduceMultipathCommandError bool InduceFCHostWWNsError bool InduceRescanError bool InduceIssueLipError bool InduceGetSysBlockDevicesError bool InduceGetDiskFormatType string InduceGetMountInfoFromDeviceError bool InduceDeviceRescanError bool InduceResizeMultipathError bool InduceFSTypeError bool InduceResizeFSError bool InduceGetMpathNameFromDeviceError bool InduceFilesystemInfoError bool } )
var ( // ErrNotImplemented is returned when a platform does not implement // the contextual function. ErrNotImplemented = errors.New("not implemented") )
var MultipathDevDiskByIDPrefix = "/dev/disk/by-id/dm-uuid-mpath-3"
MultipathDevDiskByIDPrefix is a pathname prefix for items located in /dev/disk/by-id
Functions ¶
func BindMount ¶
BindMount behaves like Mount was called with a "bind" flag set in the options list.
func DeviceRescan ¶ added in v1.3.0
DeviceRescan rescan the device for size alterations
func EvalSymlinks ¶
EvalSymlinks evaluates the provided path and updates it to remove any symlinks in its structure, replacing them with the actual path components.
func FindFSType ¶ added in v1.3.0
FindFSType fetches the filesystem type on mountpoint
func FormatAndMount ¶
FormatAndMount uses unix utils to format and mount the given disk.
func GetDiskFormat ¶
GetDiskFormat uses 'lsblk' to see if the given disk is unformatted.
func GetFCHostPortWWNs ¶ added in v1.2.0
GetFCHostPortWWNs returns the Fibrechannel Port WWNs of the local host.
func GetMpathNameFromDevice ¶ added in v1.4.0
GetMpathNameFromDevice retrieves mpath device name from device name
func GetSysBlockDevicesForVolumeWWN ¶ added in v1.2.0
GetSysBlockDevicesForVolumeWWN given a volumeWWN will return a list of devices in /sys/block for that WWN (e.g. sdx, sdaa)
func IssueLIPToAllFCHosts ¶ added in v1.2.0
IssueLIPToAllFCHosts issues the LIP command to all FC hosts.
func MakeMountArgs ¶
MakeMountArgs makes the arguments to the mount(8) command.
The argument list returned is built as follows:
mount [-t $fsType] [-o $options] [$source] $target
func Mount ¶
Mount mounts source to target as fstype with given options.
The parameters 'source' and 'fstype' must be empty strings in case they are not required, e.g. for remount, or for an auto filesystem type where the kernel handles fstype automatically.
The 'options' parameter is a list of options. Please see mount(8) for more information. If no options are required then please invoke Mount with an empty or nil argument.
func MultipathCommand ¶ added in v1.2.0
func MultipathCommand(ctx context.Context, timeoutSeconds time.Duration, chroot string, arguments ...string) ([]byte, error)
MultipathCommand executes the multipath command with a timeout and various arguments. Optionally a chroot directory can be specified for changing root directory. This only works in a container or another environment where it can chroot to /noderoot.
func RemoveBlockDevice ¶ added in v1.1.0
RemoveBlockDevice removes a block device by getting the device name from the last component of the blockDevicePath and then removing the device by writing '1' to /sys/block{deviceName}/device/delete
func RemoveDuplicates ¶
RemoveDuplicates removes duplicate and empty values from the provided slice of strings and maintains the original order of the list.
This function defers to RemoveDuplicatesExponentialOrdered, a variation of RemoveDuplicatesExponentialUnordered as described in the article "Learning Golang By Benchmarking Set Implementations" by Karl Seguin at https://goo.gl/NTU36K. The variation preserves the slice's original order and has minimal to no impact on performance.
The function's O(n^2) complexity could be altered to O(n) (linear) by using a map[string]struct{} to track unique elements with zero memory allocation. However, as long as the input data is small, the current implementation is more performant both with respect to both CPU and memory. Given that this function is used to remove duplicate mount options, there should never be a sufficiently large enough dataset that a linear version of this function would be more performant the current implementation.
The function RemoveDuplicatesLinearOrdered is the linear version of this function. If the situation should ever change such that mount options number in the thousands then this function should defer to RemoveDuplicatesLinearOrdered instead of RemoveDuplicatesExponentialOrdered.
$ go test -run Bench -bench BenchmarkRemoveDuplicates -benchmem -v goos: darwin goarch: amd64 pkg: github.com/thecodeteam/gofsutil BenchmarkRemoveDuplicates_Exponential_Ordered___SmallData-8 20000000 121 ns/op 0 B/op 0 allocs/op BenchmarkRemoveDuplicates_Exponential_Unordered_SmallData-8 20000000 99.0 ns/op 0 B/op 0 allocs/op BenchmarkRemoveDuplicates_Linear______Ordered___SmallData-8 2000000 715 ns/op 288 B/op 1 allocs/op BenchmarkRemoveDuplicates_Exponential_Ordered___BigData-8 20000 84731 ns/op 0 B/op 0 allocs/op BenchmarkRemoveDuplicates_Exponential_Unordered_BigData-8 10000 156660 ns/op 0 B/op 0 allocs/op BenchmarkRemoveDuplicates_Linear______Ordered___BigData-8 50000 36971 ns/op 20512 B/op 2 allocs/op PASS ok github.com/thecodeteam/gofsutil 22.085s
func RemoveDuplicatesExponentialOrdered ¶
RemoveDuplicatesExponentialOrdered removes duplicate and empty values from the provided slice of strings using an exponentially complex algorithm and maintains the original order of the list.
func RemoveDuplicatesExponentialUnordered ¶
RemoveDuplicatesExponentialUnordered removes duplicate and empty values from the provided slice of strings using an exponentially complex algorithm and does not maintain the original order of the list.
func RemoveDuplicatesLinearOrdered ¶
RemoveDuplicatesLinearOrdered removes duplicate and empty values from the provided slice of strings using a linearly complex algorithm and maintains the original order of the list.
func RescanSCSIHost ¶ added in v1.1.0
RescanSCSIHost will rescan scsi hosts for a specified lun. If targets are specified, only hosts who are related to the specified FC port WWN or iscsi iqn target(s) are rescanned. Targets must either begin with 0x50 for FC or iqn. for Iscsi. If lun is specified, then the rescan is for that particular volume.
func ResizeFS ¶ added in v1.3.0
func ResizeFS( ctx context.Context, volumePath, devicePath, ppathDevice, mpathDevice, fsType string, ) error
ResizeFS expands the filesystem to the new size of underlying device
func ResizeMultipath ¶ added in v1.3.0
ResizeMultipath expands the multipath volumes
func TargetIPLUNToDevicePath ¶ added in v1.2.0
func TargetIPLUNToDevicePath(ctx context.Context, targetIP string, lunID int) (map[string]string, error)
TargetIPLUNToDevicePath returns the /dev/devxxx path when presented with an ISCSI target IP and a LUN id. It returns the entry name in /dev/disk/by-path and the device path, along with error.
func UseMockFS ¶
func UseMockFS()
UseMockFS creates a mock file system for testing. This then is used with gofsutil_mock.go methods so that you can implement mock testing for calls using gofsutils.
func ValidateDevice ¶
ValidateDevice evalutes the specified path and determines whether or not it is a valid device. If true then the provided path is evaluated and returned as an absolute path without any symlinks. Otherwise an empty string is returned.
func WWNToDevicePath ¶ added in v1.1.0
WWNToDevicePath returns the device path corresponding to a LUN's WWN (World Wide Name). A null path is returned if the device isn't found.
Types ¶
type ContextKey ¶ added in v1.2.0
type ContextKey string
ContextKey is a variable containing context-keys
type DeviceMountInfo ¶ added in v1.3.0
type DeviceMountInfo struct { DeviceNames []string MPathName string PPathName string MountPoint string }
DeviceMountInfo describes the filesystem mount information related to the mounted CSI device
func GetMountInfoFromDevice ¶ added in v1.3.0
func GetMountInfoFromDevice(ctx context.Context, devID string) (*DeviceMountInfo, error)
GetMountInfoFromDevice retrieves mount information associated with the volume
type Entry ¶
type Entry struct { // Root of the mount within the filesystem. Root string // MountPoint relative to the process's root MountPoint string // MountOpts are per-mount options. MountOpts []string // FSType is the name of filesystem of the form "type[.subtype]". FSType string // MountSource is filesystem specific information or "none" MountSource string }
Entry is a superset of Info and maps to the fields of a mount table entry:
(1) mount ID: unique identifier of the mount (may be reused after umount) (2) parent ID: ID of parent (or of self for the top of the mount tree) (3) major:minor: value of st_dev for files on filesystem (4) root: root of the mount within the filesystem (5) mount point: mount point relative to the process's root (6) mount options: per mount options (7) optional fields: zero or more fields of the form "tag[:value]" (8) separator: marks the end of the optional fields (9) filesystem type: name of filesystem of the form "type[.subtype]" (10) mount source: filesystem specific information or "none" (11) super options: per super block options
type EntryScanFunc ¶
type EntryScanFunc func( ctx context.Context, entry Entry, cache map[string]Entry) (Info, bool, error)
EntryScanFunc defines the signature of the function that is optionally provided to the functions in this package that scan the mount table. The mount entry table is ignored when this function returns a false value or error.
func DefaultEntryScanFunc ¶
func DefaultEntryScanFunc() EntryScanFunc
DefaultEntryScanFunc returns the default entry scan function.
type FS ¶
type FS struct { // ScanEntry is the function used to process mount table entries. ScanEntry EntryScanFunc }
FS provides many filesystem-specific functions, such as mount, format, etc.
func (*FS) BindMount ¶
BindMount behaves like Mount was called with a "bind" flag set in the options list.
func (*FS) DeviceRescan ¶ added in v1.3.0
DeviceRescan rescan the device for size alterations
func (*FS) FindFSType ¶ added in v1.3.0
FindFSType fetches the filesystem type on mountpoint
func (*FS) Format ¶
func (fs *FS) Format( ctx context.Context, source, target, fsType string, options ...string, ) error
Format uses unix utils to format the given disk.
func (*FS) FormatAndMount ¶
func (fs *FS) FormatAndMount( ctx context.Context, source, target, fsType string, options ...string, ) error
FormatAndMount uses unix utils to format and mount the given disk.
func (*FS) FsInfo ¶ added in v1.8.0
func (fs *FS) FsInfo(ctx context.Context, path string) (int64, int64, int64, int64, int64, int64, error)
FsInfo given the path of the filesystem will return its stats
func (*FS) GetDevMounts ¶
GetDevMounts returns a slice of all mounts for the provided device.
func (*FS) GetDiskFormat ¶
GetDiskFormat uses 'lsblk' to see if the given disk is unformatted.
func (*FS) GetFCHostPortWWNs ¶ added in v1.2.0
GetFCHostPortWWNs returns the port WWN addresses of local FC adapters.
func (*FS) GetMountInfoFromDevice ¶ added in v1.3.0
GetMountInfoFromDevice retrieves mount information associated with the volume
func (*FS) GetMounts ¶
GetMounts returns a slice of all the mounted filesystems.
* Linux hosts use mount_namespaces to obtain mount information.
Support for mount_namespaces was introduced to the Linux kernel in 2.2.26 (http://man7.org/linux/man-pages/man5/proc.5.html) on 2004/02/04. The kernel documents the contents of "/proc/<pid>/mountinfo" at https://www.kernel.org/doc/Documentation/filesystems/proc.txt. - Darwin hosts parse the output of the "mount" command to obtain mount information.
func (*FS) GetMpathNameFromDevice ¶ added in v1.4.0
GetMpathNameFromDevice retrieves mpath device name from device name
func (*FS) GetSysBlockDevicesForVolumeWWN ¶ added in v1.2.0
func (fs *FS) GetSysBlockDevicesForVolumeWWN(ctx context.Context, volumeWWN string) ([]string, error)
GetSysBlockDevicesForVolumeWWN given a volumeWWN will return a list of devices in /sys/block for that WWN (e.g. sdx, sdaa)
func (*FS) IssueLIPToAllFCHosts ¶ added in v1.2.0
IssueLIPToAllFCHosts issues the LIP command to all FC hosts.
func (*FS) Mount ¶
Mount mounts source to target as fstype with given options.
The parameters 'source' and 'fstype' must be empty strings in case they are not required, e.g. for remount, or for an auto filesystem type where the kernel handles fstype automatically.
The 'options' parameter is a list of options. Please see mount(8) for more information. If no options are required then please invoke Mount with an empty or nil argument.
func (*FS) MultipathCommand ¶ added in v1.2.0
func (fs *FS) MultipathCommand(ctx context.Context, timeoutSeconds time.Duration, chroot string, arguments ...string) ([]byte, error)
MultipathCommand executes the multipath command with a timeout and various arguments. Optionally a chroot directory can be specified for changing root directory. This only works in a container or another environment where it can chroot to /noderoot.
func (*FS) RemoveBlockDevice ¶ added in v1.1.0
RemoveBlockDevice removes a block device by getting the device name from the last component of the blockDevicePath and then removing the device by writing '1' to /sys/block{deviceName}/device/delete
func (*FS) RescanSCSIHost ¶ added in v1.1.0
RescanSCSIHost will rescan scsi hosts for a specified lun. If targets are specified, only hosts who are related to the specified iqn target(s) are rescanned. If lun is specified, then the rescan is for that particular volume.
func (*FS) ResizeFS ¶ added in v1.3.0
func (fs *FS) ResizeFS( ctx context.Context, volumePath, devicePath, ppathDevice, mpathDevice, fsType string, ) error
ResizeFS expands the filesystem to the new size of underlying device
func (*FS) ResizeMultipath ¶ added in v1.3.0
ResizeMultipath resizes the multipath devices mounted on FS
func (*FS) TargetIPLUNToDevicePath ¶ added in v1.2.0
func (fs *FS) TargetIPLUNToDevicePath(ctx context.Context, targetIP string, lunID int) (map[string]string, error)
TargetIPLUNToDevicePath returns the /dev/devxxx path when presented with an ISCSI target IP and a LUN id. It returns the entry name in /dev/disk/by-path and the device path, along with error.
func (*FS) ValidateDevice ¶
ValidateDevice evalutes the specified path and determines whether or not it is a valid device. If true then the provided path is evaluated and returned as an absolute path without any symlinks. Otherwise an empty string is returned.
type FSinterface ¶
type FSinterface interface { // Architecture agnostic implementations, generally just wrappers GetDiskFormat(ctx context.Context, disk string) (string, error) Format(ctx context.Context, source, target, fsType string, options ...string) error FormatAndMount(ctx context.Context, source, target, fsType string, options ...string) error Mount(ctx context.Context, source, target, fsType string, options ...string) error BindMount(ctx context.Context, source, target string, options ...string) error Unmount(ctx context.Context, target string) error GetMounts(ctx context.Context) ([]Info, error) GetDevMounts(ctx context.Context, dev string) ([]Info, error) ValidateDevice(ctx context.Context, source string) (string, error) WWNToDevicePath(ctx context.Context, wwn string) (string, string, error) RescanSCSIHost(ctx context.Context, targets []string, lun string) error RemoveBlockDevice(ctx context.Context, blockDevicePath string) error TargetIPLUNToDevicePath(ctx context.Context, targetIP string, lunID int) (map[string]string, error) MultipathCommand(ctx context.Context, timeoutSeconds time.Duration, chroot string, arguments ...string) ([]byte, error) GetFCHostPortWWNs(ctx context.Context) ([]string, error) IssueLIPToAllFCHosts(ctx context.Context) error GetSysBlockDevicesForVolumeWWN(ctx context.Context, volumeWWN string) ([]string, error) DeviceRescan(ctx context.Context, devicePath string) error ResizeFS(ctx context.Context, volumePath, devicePath, ppathDevice, mpathDevice, fsType string) error GetMountInfoFromDevice(ctx context.Context, devID string) (*DeviceMountInfo, error) ResizeMultipath(ctx context.Context, deviceName string) error FindFSType(ctx context.Context, mountpoint string) (fsType string, err error) GetMpathNameFromDevice(ctx context.Context, device string) (string, error) FsInfo(ctx context.Context, path string) (int64, int64, int64, int64, int64, int64, error) // contains filtered or unexported methods }
FSinterface has the methods support by gofsutils.
type Info ¶
type Info struct { // Device is the filesystem path of the device to which the filesystem is // mounted. Device string // Path is the filesystem path to which Device is mounted. Path string // Source may be set to one of two values: // // 1. If this is a bind mount created with "bindfs" then Source // is set to the filesystem path (absolute, no symlinks) // bind mounted to Path. // // 2. If this is any other type of mount then Source is set to // a concatenation of the mount source and the root of // the mount within the file system (fields 10 & 4 from // the section on /proc/<pid>/mountinfo at // https://www.kernel.org/doc/Documentation/filesystems/proc.txt). // // It is not possible to diffentiate a native bind mount from a // non-bind mount after the native bind mount has been created. // Therefore, while the Source field will be set to the filesystem // path bind mounted to Path for native bind mounts, the value of // the Source field can in no way be used to determine *if* a mount // is a bind mount. Source string // Type is the filesystem type. Type string // Opts are the mount options (https://linux.die.net/man/8/mount) // used to mount the filesystem. Opts []string }
Info describes a mounted filesystem.
Please note that all fields that represent filesystem paths must be absolute and not contain any symlinks.
func GetDevMounts ¶
GetDevMounts returns a slice of all mounts for the provided device.
func GetMounts ¶
GetMounts returns a slice of all the mounted filesystems.
* Linux hosts use mount_namespaces to obtain mount information.
Support for mount_namespaces was introduced to the Linux kernel in 2.2.26 (http://man7.org/linux/man-pages/man5/proc.5.html) on 2004/02/04. The kernel documents the contents of "/proc/<pid>/mountinfo" at https://www.kernel.org/doc/Documentation/filesystems/proc.txt. - Darwin hosts parse the output of the "mount" command to obtain mount information.
func ReadProcMountsFrom ¶
func ReadProcMountsFrom( ctx context.Context, file io.Reader, _ bool, expectedFields int, scanEntry EntryScanFunc, ) ([]Info, uint32, error)
ReadProcMountsFrom parses the contents of a mount table file, typically "/proc/self/mountinfo".
From https://www.kernel.org/doc/Documentation/filesystems/proc.txt:
3.5 /proc/<pid>/mountinfo - Information about mounts --------------------------------------------------------
This file contains lines of the form:
36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue (1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11)
(1) mount ID: unique identifier of the mount (may be reused after umount) (2) parent ID: ID of parent (or of self for the top of the mount tree) (3) major:minor: value of st_dev for files on filesystem (4) root: root of the mount within the filesystem (5) mount point: mount point relative to the process's root (6) mount options: per mount options (7) optional fields: zero or more fields of the form "tag[:value]" (8) separator: marks the end of the optional fields (9) filesystem type: name of filesystem of the form "type[.subtype]" (10) mount source: filesystem specific information or "none" (11) super options: per super block options
Parsers should ignore all unrecognised optional fields. Currently the possible optional fields are:
shared:X mount is shared in peer group X master:X mount is slave to peer group X propagate_from:X mount is slave and receives propagation from peer group X (*) unbindable mount is unbindable