monky-2.1.0.0: A system state collecting library and application

PortabilityLinux
Stabilityexperimental
Maintainerongy
Safe HaskellNone

Monky.Disk.Device

Description

This module allows to read generic information about a block device and its file system.

It only works if the file system is mounted when the handle is created since it needs to *find* the mount point to get information about the file system

Synopsis

Documentation

data BlockHandle Source

The FsInfo handle exported by this module

Constructors

BlockH FilePath 

Instances

getBlockHandle :: String -> IO (Maybe (BlockHandle, String))Source

Get a fs handle for normal devices

This uses fsStat to get file system information.

fsStat takes the mount point of the file system, so we need to find the mount point.

In case of mapper devices, this is done by going through the chain of slaves.

devToMount :: String -> IO (Maybe String)Source

Get the mountpoint of a device.

Returns a mointpoint of a device. If there are multiple mountpoints, this will return the first one found. First one is mostly determined by order in procmounts and should be the one that was mounted first (time since boot).