From 0b8990d07697d6d619ea495a6c669a88a1ad63b7 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 20 Oct 2020 16:07:44 -0400 Subject: [PATCH] Add --metadatasize on pvcreate. If the caller did a CreatePV and then a CreateLV, then the explicitly created PV would not have the metadatasize that we wanted (128MiB). Change here is to just add the --metadatasize=128MiB to the 'lvm pvcreate' call. --- linux/lvm.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux/lvm.go b/linux/lvm.go index 0aaef4e..072cb2c 100644 --- a/linux/lvm.go +++ b/linux/lvm.go @@ -171,7 +171,8 @@ func (ls *linuxLVM) CreatePV(name string) (disko.PV, error) { return nilPV, err } - err = runCommandSettled("lvm", "pvcreate", "--zero=y", path) + err = runCommandSettled("lvm", "pvcreate", "--zero=y", + fmt.Sprintf("--metadatasize=%dB", pvMetaDataSize), path) if err != nil { return nilPV, err