fix: optionnal lvmetad setup in boot cmd
This commit is contained in:
parent
adb9d0095c
commit
e9ba7987b8
@ -23,11 +23,15 @@ func setupLVM() {
|
||||
}
|
||||
|
||||
// start lvmetad
|
||||
sys.Mkdir("/run/lvm", 0700)
|
||||
sys.Mkdir("/run/lock/lvm", 0700)
|
||||
sys.Run("lvmetad")
|
||||
if lvmetad, err := exec.LookPath("lvmetad"); err == nil {
|
||||
sys.Mkdir("/run/lvm", 0700)
|
||||
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
|
||||
sys.Run("lvm", "pvscan")
|
||||
|
Loading…
Reference in New Issue
Block a user