mirror of
https://github.com/kairos-io/immucore.git
synced 2025-09-17 23:38:10 +00:00
🌱 activate LVM volumes at the start (#113)
This commit is contained in:
@@ -262,3 +262,18 @@ func GetOemLabel() string {
|
||||
}
|
||||
return runtime.OEM.FilesystemLabel
|
||||
}
|
||||
|
||||
func ActivateLVM() error {
|
||||
// Remove the /etc/lvm/lvm.conf file
|
||||
// Otherwise, it has a default locking setting which activates the volumes on readonly
|
||||
// This would be the same as passing rd.lvm.conf=0 in cmdline but rather do it here than add an extra option to cmdline
|
||||
_, _ = CommandWithPath("rm /etc/lvm/lvm.conf")
|
||||
out, err := CommandWithPath("lvm vgchange --refresh --sysinit")
|
||||
Log.Debug().Str("out", out).Msg("vgchange")
|
||||
if err != nil {
|
||||
Log.Err(err).Msg("vgchange")
|
||||
}
|
||||
|
||||
_, _ = CommandWithPath("udevadm --trigger")
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user