Custom Disk Volumes¶
KIWI supports defining custom volumes by using the logical volume manager (LVM) for the Linux kernel or by setting volumes at filesystem level when filesystem supports it (e.g. btrfs).
Volumes are defined in the KIWI description file
systemdisk. This element is a child of the
Volumes themselves are added via (multiple)
elements of the
<image schemaversion="7.1" name="openSUSE-Leap-15.1"> <type image="oem" filesystem="btrfs" preferlvm="true"> <systemdisk name="vgroup"> <volume name="usr/lib" size="1G" label="library"/> <volume name="@root" freespace="500M"/> <volume name="etc_volume" mountpoint="etc" copy_on_write="false"/> <volume name="bin_volume" size="all" mountpoint="/usr/bin"/> </systemdisk> </type> </image>
Additional non-root volumes are created for each
element. Volume details can be defined by setting the following
name: Required attribute representing the volume’s name. Additionally, this attribute is interpreted as the mountpoint if the
mountpointattribute is not used.
mountpoint: Optional attribute that specifies the mountpoint of this volume.
size: Optional attribute to set the size of the volume. If no suffix (
G) is used, then the value is considered to be in megabytes.
Special name for the root volume
One can use the
@rootname to refer to the volume mounted at
/, in case some specific size attributes for the root volume have to be defined. For instance:
<volume name="@root" size="4G"/>
freespace: Optional attribute defining the additional free space added to the volume. If no suffix (
G) is used, the value is considered to be in megabytes.
label: Optional attribute to set filesystem label of the volume.
copy_on_write: Optional attribute to set the filesystem copy-on-write attribute for this volume.
The size attributes for filesystem volumes, as for btrfs, are ignored and have no effect.
systemdisk element additionally supports the following optional
name: The volume group name, by default
kiwiVGis used. This setting is only relevant for LVM volumes.
preferlvm: Boolean value instructing KIWI to prefer LVM even if the used filesystem has its own volume management system.