Now kdump are supporting network dumping via both ipv4 and ipv6. And ipv4 is the fisrt choice for kdump to setup network, if both ipv4 and ipv6 are avaiable. There is a long time for kdump to support network dumping via ipv4, so it is more stable, since a lot of practices have been took.
From my test, if hostname is used as NFS sever address, the first ip address from "getent ahosta $hostname" will be chosen during mounting. There is an option "proto=" to determine whether ipv4 or ipv6 is used in this NFS session. And it fails to mount NFS device in ipv4 mode, if this option is "proto=tcp6".
To make ip address be consistent with kdump and mount, kdump will use the first ip address from "getent ahosta $hostname" as well.
Signed-off-by: Minfei Huang mhuang@redhat.com --- NOTE: It fails to mount NFS device, if hostname is parsed to ipv6 address. Following is a workaround patch to be used to test it.
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh index 4c0e2e2..d57d90c 100755 --- a/kdump-lib-initramfs.sh +++ b/kdump-lib-initramfs.sh @@ -100,7 +100,7 @@ dump_fs()
echo "kdump: saving to $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/"
- mount -o remount,rw $_mp || return 1 + mount -o remount,rw,port=0 $_mp || return 1 mkdir -p $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR || return 1
save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/" diff --git a/mkdumprd b/mkdumprd index 78afb1a..4fa36ed 100644 --- a/mkdumprd +++ b/mkdumprd @@ -92,6 +92,7 @@ to_mount() { # kernel, filter it out here. _options=$(echo $_options | sed 's/noauto//') _options=${_options/#ro/rw} #mount fs target as rw in 2nd kernel + _options=$(echo $_options | sed 's/port=0//') # "x-initrd.mount" mount failure will trigger isolate emergency service # W/o this, systemd won't isolate, thus we won't get to emergency. # This is not applicable to remote fs mount, because if we use --- dracut-module-setup.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 4cd7107..7e2d4ad 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -313,10 +313,7 @@ kdump_install_net() { _server=$(get_remote_host $config_val)
if is_hostname $_server; then - _serv_tmp=`getent ahosts $_server | grep -v : | head -n 1` - if [ -z "$_serv_tmp" ]; then - _serv_tmp=`getent ahosts $_server | head -n 1` - fi + _serv_tmp=`getent ahosts $_server | head -n 1` _server=`echo $_serv_tmp | cut -d' ' -f1` fi