progfiguration.localhost.disks¶
Working with disks, filesystems, etc
Exceptions¶
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
Classes¶
A specification for a whole disk, to give an unpartitioned disk either a filesystem or a volume group |
|
A specification for a single partition |
|
A specification for an LVM logical volume |
Functions¶
|
Use cryptsetup to open a device idempotently |
|
Given a GPT partition label, return a path representing the partition device. |
|
Return true if a path is a mountpoint for a currently mounted filesystem |
Module Contents¶
- class progfiguration.localhost.disks.FilesystemSpec¶
- class progfiguration.localhost.disks.WholeDiskSpec¶
A specification for a whole disk, to give an unpartitioned disk either a filesystem or a volume group
- filesystem: FilesystemSpec | None = None¶
- __post_init__()¶
- class progfiguration.localhost.disks.PartitionSpec¶
A specification for a single partition
- filesystem: FilesystemSpec | None = None¶
- __post_init__()¶
- class progfiguration.localhost.disks.LvmLvSpec¶
A specification for an LVM logical volume
- filesystem: FilesystemSpec | None¶
- exception progfiguration.localhost.disks.NoDeviceFoundWithPartitionLabelError¶
Bases:
Exception
Common base class for all non-exit exceptions.
- exception progfiguration.localhost.disks.InvalidBlockDeviceSpecError¶
Bases:
Exception
Common base class for all non-exit exceptions.
- exception progfiguration.localhost.disks.MissingVolumeGroupError¶
Bases:
Exception
Common base class for all non-exit exceptions.
- exception progfiguration.localhost.disks.DuplicatePartitionLabelError¶
Bases:
Exception
Common base class for all non-exit exceptions.
- exception progfiguration.localhost.disks.EncryptionKeyfileNotFoundError¶
Bases:
Exception
Common base class for all non-exit exceptions.
- exception progfiguration.localhost.disks.EncryptionKeyfileNotSetError¶
Bases:
Exception
Common base class for all non-exit exceptions.
- progfiguration.localhost.disks.cryptsetup_open_idempotently(device: str, keyfile: str, lukslabel: str)¶
Use cryptsetup to open a device idempotently
- progfiguration.localhost.disks.gptlabel2device(label: str) str ¶
Given a GPT partition label, return a path representing the partition device.
Note that GPT partition labels are NOT filesystem labels made with e2label.
Under udev, we can find this easily via /dev/disk/by-label/$LABELNAME, but using the mdev with Alpine’s default rules, that will not exist, so we have to do it this way.