Merge pull request #11539 from swordqiu/hotfix/qj-abort-windows-ntfs-resize-for-2003

fix: do not use ntfsresize to resize NTFS partition
This commit is contained in:
Zexi Li
2021-07-02 10:01:04 +08:00
committed by GitHub
+4 -1
View File
@@ -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 {