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

Safe HaskellNone
LanguageHaskell98

Propellor.Property.Parted

Synopsis

Documentation

data TableType Source

Types of partition tables supported by parted.

Constructors

MSDOS 
GPT 
AIX 
AMIGA 
BSD 
DVH 
LOOP 
MAC 
PC98 
SUN 

Instances

data PartTable Source

A disk's partition table.

Constructors

PartTable TableType [Partition] 

partTableSize :: PartTable -> ByteSize Source

Gets the total size of the disk specified by the partition table.

data Partition Source

A partition on the disk.

Constructors

Partition 

Fields

partType :: PartType
 
partSize :: PartSize
 
partFs :: Fs
 
partMkFsOpts :: MkfsOpts
 
partFlags :: [(PartFlag, Bool)]

flags can be set or unset (parted may set some flags by default)

partName :: Maybe String

optional name for partition (only works for GPT, PC98, MAC)

Instances

mkPartition :: Fs -> PartSize -> Partition Source

Makes a Partition with defaults for non-important values.

data Fs Source

Filesystems etc that can be used for a partition.

Constructors

EXT2 
EXT3 
EXT4 
BTRFS 
REISERFS 
XFS 
FAT 
VFAT 
NTFS 
LinuxSwap 

Instances

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 

toPartSize :: ByteSize -> PartSize Source

Rounds up to the nearest MegaByte.

type MkfsOpts = [String] Source

Options passed to a mkfs.* command when making a filesystem.

Eg, ["-m0"]

data PartType Source

Type of a partition.

Constructors

Primary 
Logical 
Extended 

Instances

data PartFlag Source

Flags that can be set on a partition.

Instances

partitioned :: Eep -> FilePath -> PartTable -> Property NoInfo Source

Partitions a disk using parted, and formats the partitions.

The FilePath can be a block device (eg, /dev/sda), or a disk image file.

This deletes any existing partitions in the disk! Use with EXTREME caution!

parted :: Eep -> FilePath -> [String] -> Property NoInfo Source

Runs parted on a disk with the specified parameters.

Parted is run in script mode, so it will never prompt for input. It is asked to use cylinder alignment for the disk.

installed :: Property NoInfo Source

Gets parted installed.