Safe Haskell | None |
---|---|
Language | Haskell98 |
Propellor.Property.Parted
- data TableType
- data PartTable = PartTable TableType [Partition]
- partTableSize :: PartTable -> ByteSize
- data Partition = Partition {}
- mkPartition :: Fs -> PartSize -> Partition
- data Fs
- newtype PartSize = MegaBytes Integer
- type ByteSize = Integer
- toPartSize :: ByteSize -> PartSize
- fromPartSize :: PartSize -> ByteSize
- reducePartSize :: PartSize -> PartSize -> PartSize
- type MkfsOpts = [String]
- data PartType
- data PartFlag
- partitioned :: Eep -> FilePath -> PartTable -> Property DebianLike
- parted :: Eep -> FilePath -> [String] -> Property (DebianLike + ArchLinux)
- data Eep = YesReallyDeleteDiskContents
- installed :: Property (DebianLike + ArchLinux)
- calcPartTable :: DiskSize -> TableType -> [PartSpec DiskPart] -> PartTable
- newtype DiskSize = DiskSize ByteSize
- data DiskPart
- module Propellor.Types.PartSpec
- data DiskSpaceUse
- = Percent Int
- | RemainingSpace
- useDiskSpace :: PartSpec DiskPart -> DiskSpaceUse -> PartSpec DiskPart
Types
Types of partition tables supported by parted.
A disk's partition table.
partTableSize :: PartTable -> ByteSize Source #
Gets the total size of the disk specified by the partition table.
A partition on the disk.
Constructors
Partition | |
mkPartition :: Fs -> PartSize -> Partition Source #
Makes a Partition with defaults for non-important values.
Filesystems etc that can be used for a partition.
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.
fromPartSize :: PartSize -> ByteSize Source #
type MkfsOpts = [String] Source #
Options passed to a mkfs.* command when making a filesystem.
Eg, ["-m0"]
Type of a partition.
Flags that can be set on a partition.
Properties
partitioned :: Eep -> FilePath -> PartTable -> Property DebianLike 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 (DebianLike + ArchLinux) 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.
Constructors
YesReallyDeleteDiskContents |
PartSpec combinators
calcPartTable :: DiskSize -> TableType -> [PartSpec DiskPart] -> PartTable Source #
Calculate a partition table, for a given size of disk.
For example:
calcPartTable (DiskSize (1024 * 1024 * 1024 * 100)) MSDOS [ partition EXT2 `mountedAt` "/boot" `setSize` MegaBytes 256 `setFlag` BootFlag , partition EXT4 `mountedAt` "/" `useDisk` RemainingSpace ]
Size of a disk, in bytes.
module Propellor.Types.PartSpec
data DiskSpaceUse Source #
Constructors
Percent Int | |
RemainingSpace |
useDiskSpace :: PartSpec DiskPart -> DiskSpaceUse -> PartSpec DiskPart Source #
Make a partition use some percentage of the size of the disk (less all fixed size partitions), or the remaining space in the disk.