From 51ace7609e56792d69f72b929ea6f74bc03c2f5b Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Fri, 23 Apr 2021 08:26:15 +0000 Subject: [PATCH] feat: change parittion style to GPT on Windows --- staging/src/k8s.io/mount-utils/mount_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/mount-utils/mount_windows.go b/staging/src/k8s.io/mount-utils/mount_windows.go index 29d3bbbd376..3706b38fefd 100644 --- a/staging/src/k8s.io/mount-utils/mount_windows.go +++ b/staging/src/k8s.io/mount-utils/mount_windows.go @@ -267,7 +267,7 @@ func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target } // format disk if it is unformatted(raw) - cmd := fmt.Sprintf("Get-Disk -Number %s | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR -PassThru"+ + cmd := fmt.Sprintf("Get-Disk -Number %s | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle GPT -PassThru"+ " | New-Partition -UseMaximumSize | Format-Volume -FileSystem %s -Confirm:$false", source, fstype) if output, err := mounter.Exec.Command("powershell", "/c", cmd).CombinedOutput(); err != nil { return fmt.Errorf("diskMount: format disk failed, error: %v, output: %q", err, string(output))