osbuild2: need specify unit for lvm logical volumes

When creating the logical volumes for the `LVM2CreateStage` we
need to explicitly specify the unit byte (`B`) since lvcreate
defaults to megabytes.
This commit is contained in:
Christian Kellner 2022-02-23 21:35:15 +00:00 committed by Achilleas Koutsou
parent a9ef16a95e
commit 9bdb67de8d

View file

@ -67,7 +67,9 @@ func GenDeviceCreationStages(pt *disk.PartitionTable, filename string) []*Stage
volumes := make([]LogicalVolume, len(ent.LogicalVolumes))
for idx, lv := range ent.LogicalVolumes {
volumes[idx].Name = lv.Name
volumes[idx].Size = fmt.Sprintf("%d", lv.Size)
// NB: we need to specify the size in bytes, since lvcreate
// defaults to megabytes
volumes[idx].Size = fmt.Sprintf("%dB", lv.Size)
}
stage := NewLVM2CreateStage(