Categorygithub.com/dell/gofsutil
modulepackage
1.18.0
Repository: https://github.com/dell/gofsutil.git
Documentation: pkg.go.dev

# README

Mount

A portable Go library for filesystem related operations such as mount, format, etc.

# Functions

BindMount behaves like Mount was called with a "bind" flag set in the options list.
DefaultEntryScanFunc returns the default entry scan function.
DeviceRescan rescan the device for size alterations.
EvalSymlinks evaluates the provided path and updates it to remove any symlinks in its structure, replacing them with the actual path components.
FindFSType fetches the filesystem type on mountpoint.
Format uses unix utils to format the given disk.
FormatAndMount uses unix utils to format and mount the given disk.
FsInfo given the path of the filesystem will return its stats.
GetDevMounts returns a slice of all mounts for the provided device.
GetDiskFormat uses 'lsblk' to see if the given disk is unformatted.
GetFCHostPortWWNs returns the Fibrechannel Port WWNs of the local host.
GetMountInfoFromDevice retrieves mount information associated with the volume.
GetMounts returns a slice of all the mounted filesystems.
GetMpathNameFromDevice retrieves mpath device name from device name.
GetNVMeController retrieves the NVMe controller for a given NVMe device.
GetSysBlockDevicesForVolumeWWN given a volumeWWN will return a list of devices in /sys/block for that WWN (e.g.
IssueLIPToAllFCHosts issues the LIP command to all FC hosts.
MakeMountArgs makes the arguments to the mount(8) command.
Mount mounts source to target as fstype with given options.
MultipathCommand executes the multipath command with a timeout and various arguments.
ReadProcMountsFrom parses the contents of a mount table file, typically "/proc/self/mountinfo".
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.
RemoveDuplicates removes duplicate and empty values from the provided slice of strings and maintains the original order of the list.
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.
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.
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.
RescanSCSIHost will rescan scsi hosts for a specified lun.
ResizeFS expands the filesystem to the new size of underlying device.
ResizeMultipath expands the multipath volumes.
TargetIPLUNToDevicePath returns the /dev/devxxx path when presented with an ISCSI target IP and a LUN id.
Unmount unmounts the target.
UseMockFS creates a mock file system for testing.
UseMockSysBlockDir creates a file system for testing.
ValidateDevice evalutes the specified path and determines whether or not it is a valid device.
WWNToDevicePath returns the device path corresponding to a LUN's WWN (World Wide Name).
WWNToDevicePathX returns the symlink and device path corresponding to a LUN's WWN (World Wide Name).

# Constants

FCPortPrefix has the required port prefix for FCTargetHosts.
NoDiscard is a context option for using the nodiscard flag on mkfs.
ProcMountsFields is fields per line in procMountsPath as per https://www.kernel.org/doc/Documentation/filesystems/proc.txt.
RequestID is for logging the CSI or other type of Request ID.

# Variables

ErrNotImplemented is returned when a platform does not implement the contextual function.
GOFSMock allows you to induce errors in the various routine.
GOFSMockFCHostWWNs is a list of port WWNs on this host's FC NICs.
GOFSMockMountInfo contains mount information for filesystem volumes.
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.
GOFSMockTargetIPLUNToDevice map[string]string assumes key is of form ip-<targetIP>:-lun<decimal_lun_id>.
GOFSMockWWNToDevice allows you to return a device for a WWN.
GOFSRescanCallback is a function called when a rescan is processed.
GOFSWWNPath gives a path for the WWN entry (e.g.
GONVMEDeviceToControllerMap has device to controller mapping.
GONVMEValidDevices mocks existing devices.
MultipathDevDiskByIDPrefix is a pathname prefix for items located in /dev/disk/by-id.
PowerMaxOUIPrefix - PowerMax format 6 OUI prefix.
PowerStoreOUIPrefix - PowerStore format 6 OUI prefix.

# Structs

DeviceMountInfo describes the filesystem mount information related to the mounted CSI device.
Entry
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.
FS provides many filesystem-specific functions, such as mount, format, etc.
Info describes a mounted filesystem.

# Interfaces

FSinterface has the methods support by gofsutils.

# Type aliases

ContextKey is a variable containing context-keys.
EntryScanFunc defines the signature of the function that is optionally provided to the functions in this package that scan the mount table.