Safe Haskell | None |
---|---|
Language | Haskell98 |
- type FsType = String
- type Source = String
- type MountPoint = FilePath
- newtype MountOpts = MountOpts [String]
- class ToMountOpts a where
- toMountOpts :: a -> MountOpts
- formatMountOpts :: MountOpts -> String
- mounted :: FsType -> Source -> MountPoint -> MountOpts -> Property UnixLike
- bindMount :: FilePath -> FilePath -> Property Linux
- mount :: FsType -> Source -> MountPoint -> MountOpts -> IO Bool
- newtype SwapPartition = SwapPartition FilePath
- fstabbed :: [MountPoint] -> [SwapPartition] -> Property Linux
- genFstab :: [MountPoint] -> [SwapPartition] -> (MountPoint -> MountPoint) -> IO [String]
- noFstab :: IO Bool
- mountPoints :: IO [MountPoint]
- mountPointsBelow :: FilePath -> IO [MountPoint]
- getFsType :: MountPoint -> IO (Maybe FsType)
- getFsMountOpts :: MountPoint -> IO MountOpts
- type UUID = String
- getMountUUID :: MountPoint -> IO (Maybe UUID)
- getSourceUUID :: Source -> IO (Maybe UUID)
- type Label = String
- getMountLabel :: MountPoint -> IO (Maybe Label)
- getSourceLabel :: Source -> IO (Maybe UUID)
- getMountSource :: MountPoint -> IO (Maybe Source)
- findmntField :: String -> FilePath -> IO (Maybe String)
- blkidTag :: String -> Source -> IO (Maybe String)
- umountLazy :: FilePath -> IO ()
- unmountBelow :: FilePath -> IO ()
Documentation
type MountPoint = FilePath Source
A mount point for a filesystem.
Filesystem mount options. Eg, MountOpts ["errors=remount-ro"]
class ToMountOpts a where Source
toMountOpts :: a -> MountOpts Source
formatMountOpts :: MountOpts -> String Source
bindMount :: FilePath -> FilePath -> Property Linux Source
Bind mounts the first directory so its contents also appear in the second directory.
newtype SwapPartition Source
fstabbed :: [MountPoint] -> [SwapPartition] -> Property Linux Source
Replaces /etc/fstab with a file that should cause the currently mounted partitions to be re-mounted the same way on boot.
For each specified MountPoint, the UUID of each partition (or if there is no UUID, its label), its filesystem type, and its mount options are all automatically probed.
The SwapPartitions are also included in the generated fstab.
genFstab :: [MountPoint] -> [SwapPartition] -> (MountPoint -> MountPoint) -> IO [String] Source
Checks if /etc/fstab is not configured. This is the case if it doesn't exist, or consists entirely of blank lines or comments.
So, if you want to only replace the fstab once, and then never touch it again, allowing local modifications:
check noFstab (fstabbed mnts [])
mountPoints :: IO [MountPoint] Source
Lists all mount points of the system.
mountPointsBelow :: FilePath -> IO [MountPoint] Source
Finds all filesystems mounted inside the specified directory.
getFsMountOpts :: MountPoint -> IO MountOpts Source
Mount options for the filesystem mounted at a given location.
getMountUUID :: MountPoint -> IO (Maybe UUID) Source
UUID of filesystem mounted at a given location.
getMountLabel :: MountPoint -> IO (Maybe Label) Source
Label of filesystem mounted at a given location.
getMountSource :: MountPoint -> IO (Maybe Source) Source
Device mounted at a given location.
umountLazy :: FilePath -> IO () Source
Unmounts a device or mountpoint, lazily so any running processes don't block it.
unmountBelow :: FilePath -> IO () Source
Unmounts anything mounted inside the specified directory.