[why] When create physical volume, some choices need to be made, we should set it as yes(-y) to keep going instead of skipping
[errlog] [ 260.644037] dracut-pre-mount[4008]: /bin/dracut-pre-mount@50(sync_src_lv): lvm pvcreate /dev/sda [ 260.664078] dracut-pre-mount[4008]: WARNING: ext4 signature detected on /dev/sda at offset 1080. Wipe it? [y/n]: [n] [ 260.684036] dracut-pre-mount[4008]: Aborted wiping of ext4. [ 260.700034] dracut-pre-mount[4008]: 1 existing signature left on the device. [ 260.716076] dracut-pre-mount[4008]: /bin/dracut-pre-mount@50(sync_src_lv): reboot
Signed-off-by: Xu Xijian hdxuxijian@163.com --- container/dracut-initrd/bin/set-local-sysroot.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/container/dracut-initrd/bin/set-local-sysroot.sh b/container/dracut-initrd/bin/set-local-sysroot.sh index 2a07270..9e83742 100644 --- a/container/dracut-initrd/bin/set-local-sysroot.sh +++ b/container/dracut-initrd/bin/set-local-sysroot.sh @@ -29,13 +29,13 @@ sync_src_lv() { # ensure the physical disk has been initialized as physical volume real_pv_device="$(lvm pvs | grep -w $pv_device | awk '{print $1}')" [ "$real_pv_device" = "$pv_device" ] || { - lvm pvcreate "$pv_device" || reboot + lvm pvcreate -y "$pv_device" || reboot }
# ensure the volume group $vg_name exists real_vg_name="$(lvm pvs | grep -w $vg_name | awk '{print $2}')" [ "$real_vg_name" = "$vg_name" ] || { - lvm vgcreate "$vg_name" "$pv_device" || reboot + lvm vgcreate -y "$vg_name" "$pv_device" || reboot } }