diff --git a/cmd/agent/server/utils.go b/cmd/agent/server/utils.go index d2d094635e484c067144b8eefefe04875c1b4a13..254bbac50ef3d0ca5020e1a9de84341afe9054e3 100644 --- a/cmd/agent/server/utils.go +++ b/cmd/agent/server/utils.go @@ -97,13 +97,12 @@ func getNextPart(partA string, partB string) (string, string, error) { } mountPoint := strings.TrimSpace(string(out)) - side := partA + side := partA // 默认为sda2 + next := "A" // 默认为A + if mountPoint == "/" { - side = partB - } - next := "B" - if side != partB { - next = "A" + side = partB // 如果是根目录,设置为sda3 + next = "B" // 设置为B } return side, next, nil }