From 9bdb67de8d2c7c4014ec1328c10ecbc24ea5575f Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 23 Feb 2022 21:35:15 +0000 Subject: [PATCH] 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. --- internal/osbuild2/device.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/osbuild2/device.go b/internal/osbuild2/device.go index 29d113102..61d4506e8 100644 --- a/internal/osbuild2/device.go +++ b/internal/osbuild2/device.go @@ -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(