1
0
mirror of https://github.com/rancher/os.git synced 2025-09-02 07:15:41 +00:00

Auto resize root disk on AWS (#2191)

This commit is contained in:
niusmallnan
2017-12-26 17:59:08 +08:00
committed by GitHub
parent dab1c4ffb3
commit 55368a3897
5 changed files with 28 additions and 1 deletions

View File

@@ -184,7 +184,11 @@ func resizeDevice(cfg *rancherConfig.CloudConfig) error {
return err
}
cmd = exec.Command("resize2fs", fmt.Sprintf("%s1", cfg.Rancher.ResizeDevice))
targetPartition := fmt.Sprintf("%s1", cfg.Rancher.ResizeDevice)
if strings.Contains(cfg.Rancher.ResizeDevice, "nvme") {
targetPartition = fmt.Sprintf("%sp1", cfg.Rancher.ResizeDevice)
}
cmd = exec.Command("resize2fs", targetPartition)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err = cmd.Run()