dump_raw is similar to dump_fs when dumping to lvm2 thinp device.
Except "dd oflag=sync" is used as a substitute of "sync -f vmcore".
Signed-off-by: Tao Liu <ltao(a)redhat.com>
---
dracut-kdump.sh | 15 ++++++++++-----
dracut-module-setup.sh | 6 +++++-
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 7ec7ebd..456e77d 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -389,12 +389,17 @@ dump_raw()
/kdumpscripts/monitor_dd_progress $_src_size_mb &
fi
- dinfo "saving vmcore"
- $CORE_COLLECTOR /proc/vmcore | dd of="$1" bs=$DD_BLKSIZE >>
/tmp/dd_progress_file 2>&1 || return 1
- sync
+ if is_lvm2_thinp_device "$1"; then
+ /kdumpscripts/monitor_lvm2_thinp_autoextend "$1" "$CORE_COLLECTOR"
"dd" &
+ _mon_pid=$!
+ fi
- dinfo "saving vmcore complete"
- return 0
+ dinfo "saving vmcore"
+ $CORE_COLLECTOR /proc/vmcore | dd of="$1" bs=$DD_BLKSIZE oflag=sync >>
/tmp/dd_progress_file 2>&1
+ ret=$?
+ [ -n "$_mon_pid" ] && kill $_mon_pid
+ [ $ret -eq 0 ] && dinfo "saving vmcore complete"
+ return $ret
}
# $1: ssh key file
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index db3d91b..1216c4c 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -670,7 +670,11 @@ kdump_install_conf() {
# remove inline comments after the end of a directive.
case "$_opt" in
raw)
- _pdev=$(persistent_policy="by-id" kdump_get_persistent_dev
"$_val")
+ if is_lvm2_thinp_device "$_val"; then
+ _pdev=$(kdump_get_persistent_dev "$_val")
+ else
+ _pdev=$(persistent_policy="by-id" kdump_get_persistent_dev
"$_val")
+ fi
sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#"
"${initdir}/tmp/$$-kdump.conf"
;;
ext[234] | xfs | btrfs | minix)
--
2.33.1