diff --git a/cmd/control/install.go b/cmd/control/install.go index d17d3820..68e1e6ec 100755 --- a/cmd/control/install.go +++ b/cmd/control/install.go @@ -750,16 +750,16 @@ func mountdevice(baseName, bootDir, partition string, raw bool) (string, string, // Don't use ResolveDevice - it can fail, whereas `blkid -L LABEL` works more often cfg := config.LoadConfig() - if dev := util.ResolveDevice(cfg.Rancher.State.Dev); dev != "" { - // try the rancher.state.dev setting - partition = dev + cmd := exec.Command("blkid", "-L", "RANCHER_BOOT") + log.Debugf("Run(%v)", cmd) + cmd.Stderr = os.Stderr + if out, err := cmd.Output(); err == nil { + partition = strings.TrimSpace(string(out)) + baseName = filepath.Join(baseName, "boot") } else { - cmd := exec.Command("blkid", "-L", "RANCHER_BOOT") - log.Debugf("Run(%v)", cmd) - cmd.Stderr = os.Stderr - if out, err := cmd.Output(); err == nil { - partition = strings.TrimSpace(string(out)) - baseName = filepath.Join(baseName, "boot") + if dev := util.ResolveDevice(cfg.Rancher.State.Dev); dev != "" { + // try the rancher.state.dev setting + partition = dev } else { cmd := exec.Command("blkid", "-L", "RANCHER_STATE") log.Debugf("Run(%v)", cmd) @@ -770,7 +770,7 @@ func mountdevice(baseName, bootDir, partition string, raw bool) (string, string, } } device := "" - cmd := exec.Command("lsblk", "-no", "pkname", partition) + cmd = exec.Command("lsblk", "-no", "pkname", partition) log.Debugf("Run(%v)", cmd) cmd.Stderr = os.Stderr if out, err := cmd.Output(); err == nil {