fix: optionnal lvmetad setup in boot cmd

This commit is contained in:
Mikaël Cluseau 2022-12-08 12:50:34 +01:00
parent adb9d0095c
commit e9ba7987b8

View File

@ -23,11 +23,15 @@ func setupLVM() {
} }
// start lvmetad // start lvmetad
sys.Mkdir("/run/lvm", 0700) if lvmetad, err := exec.LookPath("lvmetad"); err == nil {
sys.Mkdir("/run/lock/lvm", 0700) sys.Mkdir("/run/lvm", 0700)
sys.Run("lvmetad") sys.Mkdir("/run/lock/lvm", 0700)
sys.Run(lvmetad)
sys.WaitFile("/run/lvm/lvmetad.socket", time.After(30*time.Second)) sys.WaitFile("/run/lvm/lvmetad.socket", time.After(30*time.Second))
} else {
log.Print("skipping lvmetad setup: ", err)
}
// scan devices // scan devices
sys.Run("lvm", "pvscan") sys.Run("lvm", "pvscan")