From 179562bc402f00c4a5db6024e8af21f21653ef56 Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Fri, 2 Jul 2021 09:13:37 +0800 Subject: [PATCH] fix: do not use ntfsresize to resize NTFS partition This makes resizing windows 2003 ntfs partition non-functional --- pkg/hostman/diskutils/fsutils/fsutils.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/hostman/diskutils/fsutils/fsutils.go b/pkg/hostman/diskutils/fsutils/fsutils.go index d548f21a3f..96d9d2e44b 100644 --- a/pkg/hostman/diskutils/fsutils/fsutils.go +++ b/pkg/hostman/diskutils/fsutils/fsutils.go @@ -264,7 +264,10 @@ func ResizePartitionFs(fpath, fs string, raiseError bool) (error, bool) { {"sleep", "2"}, {"rm", "-fr", tmpPoint}} } else if fs == "ntfs" { - cmds = [][]string{{"ntfsresize", "-c", fpath}, {"ntfsresize", "-P", "-f", fpath}} + // the following cmds may cause disk damage on Windows 10 with new version of NTFS + // comment out the following codes only impact Windows 2003 + // as windows 2003 deprecated, so choose to sacrifies windows 2003 + // cmds = [][]string{{"ntfsresize", "-c", fpath}, {"ntfsresize", "-P", "-f", fpath}} } if len(cmds) > 0 {