blivet.formats package

Submodules

blivet.formats.biosboot module

class blivet.formats.biosboot.BIOSBoot(**kwargs)

Bases: blivet.formats.DeviceFormat

BIOS boot partition for GPT disklabels.

Parameters:
  • device (str) – path to the block device node
  • exists (bool) – whether the formatting exists

Note

The ‘device’ kwarg is required for existing formats.

parted_flag = 12
status

Return an attribute of instance, which is of type owner.

supported

Return an attribute of instance, which is of type owner.

blivet.formats.disklabel module

class blivet.formats.disklabel.DiskLabel(**kwargs)

Bases: blivet.formats.DeviceFormat

Disklabel

Parameters:
  • device (str) – full path to the block device node
  • uuid (str) – disklabel UUID
  • label_type (str) – type of disklabel to create
  • exists (bool) – whether the formatting exists
add_partition(start, end, ptype=None)

Add a partition to the disklabel.

Parameters:
  • start (int) – start sector
  • end (int) – end sector
  • ptype (int (parted partition type constant) or NoneType) – partition type or None

Partition type will default to either PARTITION_NORMAL or PARTITION_LOGICAL, depending on whether the start sector is within an extended partition.

alignment

Return an attribute of instance, which is of type owner.

commit()

Commit the current partition table to disk and notify the OS.

commit_to_disk()

Commit the current partition table to disk.

desc

Return an attribute of instance, which is of type owner.

dict

Return an attribute of instance, which is of type owner.

end_alignment

Return an attribute of instance, which is of type owner.

extended_partition

Return an attribute of instance, which is of type owner.

first_partition

Return an attribute of instance, which is of type owner.

free

Return an attribute of instance, which is of type owner.

fresh_parted_disk()

Return a new, empty parted.Disk instance for this device.

get_alignment(size=None)

Return an appropriate alignment for a new partition.

Parameters:size (Size) – proposed partition size (optional)
Returns:the appropriate alignment to use
Return type:parted.Alignment
:raises AlignmentError: if the partition is too
small to be aligned
get_end_alignment(size=None, alignment=None)

Return an appropriate end-alignment for a new partition.

Parameters:
  • size (Size) – proposed partition size (optional)
  • alignment (parted.Alignment) – the start alignment (optional)
Returns:

the appropriate alignment to use

Return type:

parted.Alignment

:raises AlignmentError: if the partition is too
small to be aligned
label_type

The disklabel type (eg: ‘gpt’, ‘msdos’)

logical_partitions

Return an attribute of instance, which is of type owner.

magic_partition_number

Number of disklabel-type-specific special partition.

name

Return an attribute of instance, which is of type owner.

parted_device

Return an attribute of instance, which is of type owner.

parted_disk

Return an attribute of instance, which is of type owner.

partitions

Return an attribute of instance, which is of type owner.

primary_partitions

Return an attribute of instance, which is of type owner.

remove_partition(partition)

Remove a partition from the disklabel.

Parameters:partition (parted.Partition) – the partition to remove
reset_parted_disk()

Set this instance’s parted_disk to reflect the disk’s contents.

sector_size

Return an attribute of instance, which is of type owner.

size

Return an attribute of instance, which is of type owner.

status

Device status.

update_orig_parted_disk()
update_parted_disk()

re-read the disklabel from the device

blivet.formats.dmraid module

class blivet.formats.dmraid.DMRaidMember(**kwargs)

Bases: blivet.formats.DeviceFormat

A dmraid member disk.

Parameters:
  • device (str) – path to the underlying device (required)
  • uuid (str) – this format’s UUID
  • exists (bool) – whether this is an existing format
create(**kwargs)
destroy(**kwargs)
raidmem

Return an attribute of instance, which is of type owner.

blivet.formats.fs module

Filesystem classes.

class blivet.formats.fs.AppleBootstrapFS(**kwargs)

Bases: blivet.formats.fs.HFS

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

supported

Return an attribute of instance, which is of type owner.

class blivet.formats.fs.BTRFS(**kwargs)

Bases: blivet.formats.fs.FS

btrfs filesystem

container_uuid

Return an attribute of instance, which is of type owner.

create(**kwargs)
destroy(**kwargs)
class blivet.formats.fs.BindFS(**kwargs)

Bases: blivet.formats.fs.FS

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

class blivet.formats.fs.DevPtsFS(**kwargs)

Bases: blivet.formats.fs.NoDevFS

devpts filesystem.

class blivet.formats.fs.EFIFS(**kwargs)

Bases: blivet.formats.fs.FATFS

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

supported

Return an attribute of instance, which is of type owner.

class blivet.formats.fs.EFIVarFS(**kwargs)

Bases: blivet.formats.fs.NoDevFS

class blivet.formats.fs.Ext2FS(**kwargs)

Bases: blivet.formats.fs.FS

ext2 filesystem.

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

parted_system = <_ped.FileSystemType object>
class blivet.formats.fs.Ext3FS(**kwargs)

Bases: blivet.formats.fs.Ext2FS

ext3 filesystem.

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

parted_system = <_ped.FileSystemType object>
class blivet.formats.fs.Ext4FS(**kwargs)

Bases: blivet.formats.fs.Ext3FS

ext4 filesystem.

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

parted_system = <_ped.FileSystemType object>
class blivet.formats.fs.FATFS(**kwargs)

Bases: blivet.formats.fs.FS

FAT filesystem.

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

parted_system = <_ped.FileSystemType object>
class blivet.formats.fs.FS(**kwargs)

Bases: blivet.formats.DeviceFormat

Filesystem base class.

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

classmethod biggest_overhead_FS(fs_list=None)

Get format class from list of format classes with largest space taken by metadata.

Parameters:fs_list (list of classes with parent FS) – list of input filesystems
Returns:FS which takes most space by metadata
controllable

Return an attribute of instance, which is of type owner.

desc

Return an attribute of instance, which is of type owner.

dict

Return an attribute of instance, which is of type owner.

do_check()

Run a filesystem check.

Raises:FSError
formattable

Return an attribute of instance, which is of type owner.

free

The amount of space that can be gained by resizing this filesystem to its minimum size.

classmethod free_space_estimate(device_size)

Get estimated free space when format will be done on device with size device_size.

Note

This is more guess than precise number. To get precise space taken the FS must provide this number to us.

Parameters:device_size (Size object) – original device size
Returns:estimated free size after format
Return type:Size
classmethod get_required_size(free_space)

Get device size we need to get a free_space on the device. This calculation will add metadata to usable device on the FS.

Note

This is more guess than precise number. To get precise space taken the FS must provide this number to us.

Parameters:free_space (Size object) – how much usable size we want on newly created device
Returns:estimated size of the device which will have given amount of free_space
Return type:Size
label

this filesystem’s label

label_format_ok(label)

Return True if the label has an acceptable format for this filesystem. None, which represents accepting the default for this device, is always acceptable.

Parameters:label (str or None) – A possible label
labeling()

Returns True if this filesystem uses labels, otherwise False.

Return type:bool
load_module()

Load whatever kernel module is required to support this filesystem.

mount(**kwargs)

Mount this filesystem.

keyword options:
 mount options (overrides all other option strings)
type options:str.
keyword chroot:prefix to apply to mountpoint
keyword mountpoint:
 mountpoint (overrides self.mountpoint)
raises:FSError

Note

When mounted multiple times the unmount method needs to be called with a specific mountpoint to unmount, otherwise it will try to unmount the most recent one listed by the system.

mount_type

Return an attribute of instance, which is of type owner.

mountable

Return an attribute of instance, which is of type owner.

populate_ksdata(data)
read_label()

Read this filesystem’s label.

Returns:the filesystem’s label
Return type:str

Raises a FSReadLabelError if the label can not be read.

relabels()

Returns True if it is possible to relabel this filesystem after creation, otherwise False.

Return type:bool
resizable

Can formats of this filesystem type be resized?

status

Return an attribute of instance, which is of type owner.

supported

Return an attribute of instance, which is of type owner.

sync(root='/')

Ensure that data we’ve written is at least in the journal.

This is a little odd because xfs_freeze will only be available under the install root.

system_mountpoint

Get current mountpoint

returns: mountpoint rtype: str or None

If there are multiple mountpoints it returns the most recent one.

test_mount()

Try to mount the fs and return True if successful.

unmount(**kwargs)

Unmount this filesystem.

Parameters:mountpoint (str) – Optional mountpoint to be unmounted.
Raises:FSError

If mountpoint isn’t passed this will unmount the most recent mountpoint listed by the system. Override this behavior by passing a specific mountpoint. FSError will be raised in either case if the path doesn’t exist.

update_size_info()

Update this filesystem’s current and minimum size (for resize).

utils_available

Return an attribute of instance, which is of type owner.

write_label()

Create a label for this filesystem.

Raises:FSError

If self.label is None, this means accept the default, so raise an FSError in this case.

Raises a FSError if the label can not be set.

class blivet.formats.fs.GFS2(**kwargs)

Bases: blivet.formats.fs.FS

gfs2 filesystem.

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

supported

Is this filesystem a supported type?

class blivet.formats.fs.HFS(**kwargs)

Bases: blivet.formats.fs.FS

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

parted_system = <_ped.FileSystemType object>
class blivet.formats.fs.HFSPlus(**kwargs)

Bases: blivet.formats.fs.FS

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

parted_system = <_ped.FileSystemType object>
class blivet.formats.fs.Iso9660FS(**kwargs)

Bases: blivet.formats.fs.FS

ISO9660 filesystem.

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

class blivet.formats.fs.JFS(**kwargs)

Bases: blivet.formats.fs.FS

JFS filesystem

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

parted_system = <_ped.FileSystemType object>
supported

Is this filesystem a supported type?

class blivet.formats.fs.MacEFIFS(**kwargs)

Bases: blivet.formats.fs.HFSPlus

supported

Return an attribute of instance, which is of type owner.

class blivet.formats.fs.NFS(**kwargs)

Bases: blivet.formats.fs.FS

NFS filesystem.

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

class blivet.formats.fs.NFSv4(**kwargs)

Bases: blivet.formats.fs.NFS

NFSv4 filesystem.

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

class blivet.formats.fs.NTFS(**kwargs)

Bases: blivet.formats.fs.FS

ntfs filesystem.

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

parted_system = <_ped.FileSystemType object>
class blivet.formats.fs.NoDevFS(**kwargs)

Bases: blivet.formats.fs.FS

nodev filesystem base class

type

Return an attribute of instance, which is of type owner.

class blivet.formats.fs.ProcFS(**kwargs)

Bases: blivet.formats.fs.NoDevFS

class blivet.formats.fs.ReiserFS(**kwargs)

Bases: blivet.formats.fs.FS

reiserfs filesystem

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

parted_system = <_ped.FileSystemType object>
supported

Is this filesystem a supported type?

class blivet.formats.fs.SELinuxFS(**kwargs)

Bases: blivet.formats.fs.NoDevFS

class blivet.formats.fs.SysFS(**kwargs)

Bases: blivet.formats.fs.NoDevFS

class blivet.formats.fs.TmpFS(**kwargs)

Bases: blivet.formats.fs.NoDevFS

create(**kwargs)

A filesystem is created automatically once tmpfs is mounted.

destroy(*args, **kwargs)

The device and its filesystem are automatically destroyed once the mountpoint is unmounted.

do_resize()
free

Return an attribute of instance, which is of type owner.

class blivet.formats.fs.USBFS(**kwargs)

Bases: blivet.formats.fs.NoDevFS

class blivet.formats.fs.XFS(**kwargs)

Bases: blivet.formats.fs.FS

XFS filesystem

Parameters:
  • device – path to the block device node (required for existing filesystems)
  • mountpoint – the filesystem’s planned mountpoint
  • label – the filesystem label
  • uuid – the filesystem UUID
  • mountopts (str) – mount options for the filesystem
  • size – the filesystem’s size in MiB
  • exists (bool) – indicates whether this is an existing filesystem

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

parted_system = <_ped.FileSystemType object>

blivet.formats.fslib module

blivet.formats.fslib.update_kernel_filesystems()

blivet.formats.luks module

class blivet.formats.luks.LUKS(**kwargs)

Bases: blivet.formats.DeviceFormat

Parameters:
  • device – the path to the underlying device
  • uuid – the LUKS UUID
  • exists (bool) – indicates whether this is an existing format
  • name – the name of the mapped device
  • passphrase (str) – device passphrase
  • key_file (str) – path to a file containing a key
  • cipher (str) – cipher mode
  • key_size (int) – key size in bits
  • escrow_cert (str) – certificate (contents) to use for key escrow
  • add_backup_passphrase (bool.) – generate a backup passphrase?
  • min_luks_entropy (int) – minimum entropy in bits required for format creation

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

add_passphrase(passphrase)

Add a new passphrase.

Add the specified passphrase to an available key slot in the LUKS header.

configured

To be ready we need a key or passphrase and a map name.

controllable

Return an attribute of instance, which is of type owner.

destroyable

Return an attribute of instance, which is of type owner.

dict

Return an attribute of instance, which is of type owner.

escrow(directory, backup_passphrase)
formattable

Return an attribute of instance, which is of type owner.

has_key

Return an attribute of instance, which is of type owner.

key_file

Path to key file to be used in /etc/crypttab

name

Return an attribute of instance, which is of type owner.

passphrase

Return an attribute of instance, which is of type owner.

remove_passphrase()

Remove the saved passphrase (and possibly key file) from the LUKS header.

status

Return an attribute of instance, which is of type owner.

supported

Return an attribute of instance, which is of type owner.

update_size_info()

Update this format’s current size.

blivet.formats.lvmpv module

class blivet.formats.lvmpv.LVMPhysicalVolume(**kwargs)

Bases: blivet.formats.DeviceFormat

An LVM physical volume.

Parameters:
  • device – path to the block device node
  • uuid – this PV’s uuid (not the VG uuid)
  • exists (bool) – indicates whether this is an existing format
  • vg_name – the name of the VG this PV belongs to
  • vg_uuid – the UUID of the VG this PV belongs to
  • pe_start (Size) – offset of first physical extent
  • data_alignment (Size) – data alignment (for non-existent PVs)
  • free (Size) – free space in the PV

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

container_uuid

Return an attribute of instance, which is of type owner.

destroyable

Return an attribute of instance, which is of type owner.

dict

Return an attribute of instance, which is of type owner.

formattable

Return an attribute of instance, which is of type owner.

free

Information about the free space in this PV

parted_flag = 6
status

Return an attribute of instance, which is of type owner.

supported

Return an attribute of instance, which is of type owner.

update_size_info()

Update this format’s current size.

blivet.formats.mdraid module

class blivet.formats.mdraid.MDRaidMember(**kwargs)

Bases: blivet.formats.DeviceFormat

An mdraid member disk.

Parameters:
  • device – path to block device node
  • uuid – this member device’s uuid
  • exists (bool) – whether this is an existing format
  • md_uuid – the uuid of the array this device belongs to

Note

The ‘device’ kwarg is required for existing formats.

container_uuid

Return an attribute of instance, which is of type owner.

destroyable

Return an attribute of instance, which is of type owner.

dict

Return an attribute of instance, which is of type owner.

formattable

Return an attribute of instance, which is of type owner.

hidden

Return an attribute of instance, which is of type owner.

parted_flag = 5
status

Return an attribute of instance, which is of type owner.

supported

Return an attribute of instance, which is of type owner.

blivet.formats.multipath module

class blivet.formats.multipath.MultipathMember(**kwargs)

Bases: blivet.formats.DeviceFormat

A multipath member disk.

Parameters:
  • device – path to the underlying device (required)
  • uuid – this format’s UUID
  • exists (bool) – whether this is an existing format
create(**kwargs)
destroy(**kwargs)
member

Return an attribute of instance, which is of type owner.

blivet.formats.prepboot module

class blivet.formats.prepboot.PPCPRePBoot(**kwargs)

Bases: blivet.formats.DeviceFormat

Generic device format.

Parameters:
  • device – path to block device node
  • exists (bool) – whether this is an existing format

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

parted_flag = 10
status

Return an attribute of instance, which is of type owner.

supported

Return an attribute of instance, which is of type owner.

blivet.formats.swap module

class blivet.formats.swap.SwapSpace(**kwargs)

Bases: blivet.formats.DeviceFormat

Swap space

Parameters:
  • device – path to the block device node
  • uuid – this swap space’s uuid
  • exists (bool) – whether this is an existing format
  • label – this swap space’s label
  • priority (int) – this swap space’s priority

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the ‘device’ attribute be set before the create() method runs. You can specify the device at the last moment by via the ‘device’ kwarg to the create() method.

controllable

Return an attribute of instance, which is of type owner.

dict

Return an attribute of instance, which is of type owner.

formattable

Return an attribute of instance, which is of type owner.

label

the label for this swap space

label_format_ok(label)

Returns True since no known restrictions on the label.

labeling()

Returns True as mkswap can write a label to the swap space.

parted_flag = 3
parted_system = <_ped.FileSystemType object>
priority

The priority of the swap device

status

Device status.

supported

Return an attribute of instance, which is of type owner.

Module contents

class blivet.formats.DeviceFormat(**kwargs)

Bases: blivet.util.ObjectID

Generic device format.

This represents the absence of recognized formatting. That could mean a device is uninitialized, has had zeros written to it, or contains some valid formatting that this module does not support.

Parameters:
  • device (str) – The path to the device node.
  • uuid (str) – the formatting’s UUID.
  • exists – Whether the formatting exists. (default: False)
Raises:

ValueError

Note

The ‘device’ kwarg is required for existing formats. For non- existent formats, it is only necessary that the device attribute be set before the create() method runs. Note that you can specify the device at the last moment by specifying it via the ‘device’ kwarg to the create() method.

check

Whether or not this format is checked on boot.

controllable

Are external utilities available to allow this format to be both setup and teared down.

Returns:True if this format can be set up, otherwise False
Return type:bool
create(**kwargs)

Write the formatting to the specified block device.

Parameters:device (str.) – path to device node
Raises:FormatCreateError
Returns:None.
create_options

options to be used when running mkfs

current_size

The filesystem’s current actual size.

desc

Return an attribute of instance, which is of type owner.

destroy(**kwargs)

Remove the formatting from the associated block device.

Raises:FormatDestroyError
Returns:None.
destroyable

Do we have the facilities to destroy a format of this type.

device

Full path the device this format occupies

dict

Return an attribute of instance, which is of type owner.

do_resize()

Resize this filesystem based on this instance’s target_size attr.

Raises:FSResizeError, FormatResizeError
dump

Whether or not this format will be dumped by dump(8).

formattable

Can we create formats of this type?

hidden

Whether devices with this formatting should be hidden in UIs.

ks_mountpoint

Return an attribute of instance, which is of type owner.

label_format_ok(label)

Checks whether the format of the label is OK for whatever application is used by blivet to write a label for this format. If there is no application that blivet uses to write a label, then no format is acceptable, so must return False.

Parameters:label (str) – The label to be checked
Return type:bool
Returns:True if the format of the label is OK, otherwise False
labeling()

Returns False by default since most formats are non-labeling.

linux_native

Is this format type native to linux?

max_size

Maximum size for this format type.

min_size

Return an attribute of instance, which is of type owner.

mountable

Is this something we can mount?

name

Return an attribute of instance, which is of type owner.

options

fstab entry option string

packages

Packages required to manage formats of this type.

parted_flag = None
parted_system = None
populate_ksdata(data)
resizable

Can formats of this type be resized?

setup(**kwargs)

Activate the formatting.

Parameters:device (str.) – device node path
Raises:FormatSetupError.
Returns:None.
size

This filesystem’s size, accounting for pending changes

status

Return an attribute of instance, which is of type owner.

supported

Is this format a supported type?

Are the necessary external applications required by the functionality that this format provides actually provided by the environment in which blivet is running?

target_size

Target size for this filesystem

teardown(**kwargs)

Deactivate the formatting.

type

Return an attribute of instance, which is of type owner.

update_size_info()

Update this format’s current and minimum size (for resize).

blivet.formats.collect_device_format_classes()

Pick up all device format classes from this directory.

Note

Modules must call register_device_format() to make format classes available to getFormat().

blivet.formats.get_default_filesystem_type()
blivet.formats.get_device_format_class(fmt_type)

Return an appropriate format class.

Parameters:fmt_type (str.) – The name of the format type.
Returns:The chosen DeviceFormat class
Return type:class.

Returns None if no class is found for fmt_type.

blivet.formats.get_format(fmt_type, *args, **kwargs)

Return an instance of the appropriate DeviceFormat class.

Parameters:fmt_type (str.) – The name of the formatting type
Returns:the format instance
Return type:DeviceFormat
Raises:ValueError

Note

Any additional arguments will be passed on to the constructor for the format class. See the various DeviceFormat subclasses for an exhaustive list of the arguments that can be passed.

blivet.formats.register_device_format(fmt_class)