force-format xfs-filesystems too

Signed-off-by: David J. M. Karlsen <david@davidkarlsen.com>
This commit is contained in:
David J. M. Karlsen 2021-09-10 23:51:27 +02:00
parent 1e607a500f
commit ca1d25d038
No known key found for this signature in database
GPG Key ID: F54982D216088EE1

View File

@ -30,7 +30,7 @@ import (
"syscall"
"time"
"k8s.io/klog/v2"
"k8s.io/klog/v2"
utilexec "k8s.io/utils/exec"
utilio "k8s.io/utils/io"
)
@ -439,6 +439,11 @@ func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target
"-m0", // Zero blocks reserved for super-user
source,
}
} else if fstype == "xfs" {
args = []string{
"-f", // force flag
source,
}
}
klog.Infof("Disk %q appears to be unformatted, attempting to format as type: %q with options: %v", source, fstype, args)