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

Safe HaskellNone
LanguageHaskell98

Propellor.Property.DiskImage.PartSpec

Description

Disk image partition specification and combinators.

Synopsis

Documentation

type PartSpec = (Maybe MountPoint, MountOpts, PartSize -> Partition) Source #

Specifies a mount point, mount options, and a constructor for a Partition.

The size that is eventually provided is the amount of space needed to hold the files that appear in the directory where the partition is to be mounted. Plus a fudge factor, since filesystems have some space overhead.

defSz :: PartSize Source #

Partitions that are not to be mounted (ie, LinuxSwap), or that have no corresponding directory in the chroot will have 128 MegaBytes provided as a default size.

fudge :: PartSize -> PartSize Source #

Add 2% for filesystem overhead. Rationalle for picking 2%: A filesystem with 1% overhead might just sneak by as acceptable. Double that just in case. Add an additional 3 mb to deal with non-scaling overhead of filesystems (eg, superblocks). Add an additional 200 mb for temp files, journals, etc.

swapPartition :: PartSize -> PartSpec Source #

Specifies a swap partition of a given size.

partition :: Fs -> PartSpec Source #

Specifies a partition with a given filesystem.

The partition is not mounted anywhere by default; use the combinators below to configure it.

mountedAt :: PartSpec -> FilePath -> PartSpec Source #

Specifies where to mount a partition.

mountOpt :: ToMountOpts o => PartSpec -> o -> PartSpec Source #

Specifies a mount option, such as "noexec"

errorReadonly :: MountOpts Source #

Mount option to make a partition be remounted readonly when there's an error accessing it.

addFreeSpace :: PartSpec -> PartSize -> PartSpec Source #

Adds additional free space to the partition.

setSize :: PartSpec -> PartSize -> PartSpec Source #

Forced a partition to be a specific size, instead of scaling to the size needed for the files in the chroot.

reservedSpacePercentage :: PartSpec -> Int -> PartSpec Source #

Sets the percent of the filesystem blocks reserved for the super-user.

The default is 5% for ext2 and ext4. Some filesystems may not support this.

setFlag :: PartSpec -> PartFlag -> PartSpec Source #

Sets a flag on the partition.

extended :: PartSpec -> PartSpec Source #

Makes a MSDOS partition be Extended, rather than Primary.

data Partition Source #

A partition on the disk.

newtype PartSize Source #

All partition sizing is done in megabytes, so that parted can automatically lay out the partitions.

Note that these are SI megabytes, not mebibytes.

Constructors

MegaBytes Integer 

data PartFlag Source #

Flags that can be set on a partition.

data TableType Source #

Types of partition tables supported by parted.

Constructors

MSDOS 
GPT 
AIX 
AMIGA 
BSD 
DVH 
LOOP 
MAC 
PC98 
SUN 

data Fs Source #

Filesystems etc that can be used for a partition.

Constructors

EXT2 
EXT3 
EXT4 
BTRFS 
REISERFS 
XFS 
FAT 
VFAT 
NTFS 
LinuxSwap 

Instances

Eq Fs Source # 

Methods

(==) :: Fs -> Fs -> Bool #

(/=) :: Fs -> Fs -> Bool #

Show Fs Source # 

Methods

showsPrec :: Int -> Fs -> ShowS #

show :: Fs -> String #

showList :: [Fs] -> ShowS #

type MountPoint = FilePath Source #

A mount point for a filesystem.