Storage partition matching¶
A disk is found once and then pinned explains why the matching is deterministic; this page shows where the code makes it so.
pkg/config renders the definitions¶
pkg/config/storage.go renders a node's storage section from its SystemDisk and Volume
documents, with the systemd-repart definitions of VAR and the volumes:
definitionsets each partition'sTypetostorage.PartitionTypeof its label, so each label has a GPT type UUID of its own.- The system disk's definitions are named
50-var.conffor VAR and60-<volume>.conffor each volume, so repart reads them in that order. A volume on a disk of its own gets10-<volume>.confon that disk. - Each disk's seed is
storage.UUIDOfof the node's name and the disk's.
A Volume's repart field passes further repart.d keys through. reservedRepartKeys lists the
keys the typed fields set, which are refused there: Type, Label, Encrypt, Format,
SizeMinBytes, SizeMaxBytes and MountPoint.
pkg/storage/node runs systemd-repart¶
pkg/storage/node runs systemd-repart once per disk to create and grow the partitions. It passes
the disk's seed as --seed and refuses a disk without one, since repart would otherwise pick a
seed of its own. On a disk other than the system disk it also passes --empty=allow, because the
disk was checked to be unused before it was pinned.