propellor-5.6.0: property-based host configuration management in haskell

Safe HaskellNone
LanguageHaskell98

Propellor.Property.Mount

Description

Properties in this module ensure that things are currently mounted, but without making the mount persistent. Use Fstab to configure persistent mounts.

Synopsis

Documentation

type FsType = String Source #

type of filesystem to mount ("auto" to autodetect)

type Source = String Source #

A device or other thing to be mounted.

type MountPoint = FilePath Source #

A mount point for a filesystem.

newtype MountOpts Source #

Filesystem mount options. Eg, MountOpts ["errors=remount-ro"]

For default mount options, use mempty.

Constructors

MountOpts [String] 
Instances
Semigroup MountOpts Source # 
Instance details

Defined in Propellor.Property.Mount

Methods

(<>) :: MountOpts -> MountOpts -> MountOpts #

sconcat :: NonEmpty MountOpts -> MountOpts

stimes :: Integral b => b -> MountOpts -> MountOpts

Monoid MountOpts Source # 
Instance details

Defined in Propellor.Property.Mount

ToMountOpts MountOpts Source # 
Instance details

Defined in Propellor.Property.Mount

class ToMountOpts a where Source #

Minimal complete definition

toMountOpts

Methods

toMountOpts :: a -> MountOpts Source #

Instances
ToMountOpts String Source # 
Instance details

Defined in Propellor.Property.Mount

Methods

toMountOpts :: String -> MountOpts Source #

ToMountOpts MountOpts Source # 
Instance details

Defined in Propellor.Property.Mount

mounted :: FsType -> Source -> MountPoint -> MountOpts -> Property UnixLike Source #

Mounts a device, without listing it in /etc/fstab.

Note that this property will fail if the device is already mounted at the MountPoint.

bindMount :: FilePath -> FilePath -> Property Linux Source #

Bind mounts the first directory so its contents also appear in the second directory.

swapOn :: Source -> RevertableProperty Linux Linux Source #

Enables swapping to a device, which must be formatted already as a swap partition.

mount :: FsType -> Source -> MountPoint -> MountOpts -> IO Bool Source #

mountPoints :: IO [MountPoint] Source #

Lists all mount points of the system.

isMounted :: MountPoint -> IO Bool Source #

Checks if anything is mounted at the MountPoint.

mountPointsBelow :: FilePath -> IO [MountPoint] Source #

Finds all filesystems mounted inside the specified directory.

getFsType :: MountPoint -> IO (Maybe FsType) Source #

Filesystem type mounted at a given location.

getFsMountOpts :: MountPoint -> IO MountOpts Source #

Mount options for the filesystem mounted at a given location.

type UUID = String Source #

getMountUUID :: MountPoint -> IO (Maybe UUID) Source #

UUID of filesystem mounted at a given location.

getSourceUUID :: Source -> IO (Maybe UUID) Source #

UUID of a device

type Label = String Source #

getMountLabel :: MountPoint -> IO (Maybe Label) Source #

Label of filesystem mounted at a given location.

getSourceLabel :: Source -> IO (Maybe UUID) Source #

Label of a device

getMountSource :: MountPoint -> IO (Maybe Source) Source #

Device mounted at a given location.

getMountContaining :: FilePath -> IO (Maybe Source) Source #

Device that a given path is located within.

findmntField :: String -> [String] -> IO (Maybe String) Source #

blkidTag :: String -> Source -> IO (Maybe String) Source #

umountLazy :: FilePath -> IO () Source #

Unmounts a device or mountpoint, lazily so any running processes don't block it.

Note that this will fail if it's not mounted.

unmountBelow :: FilePath -> IO () Source #

Unmounts anything mounted inside the specified directory, not including the directory itself.