If dump target is nfs with version < 4, noauto won't work as dracut will stop rpc server before starting kdump.sh
So don't mark it as noauto, let dracut setup it properly, kdump.sh will just use it.
Signed-off-by: Kairui Song kasong@redhat.com --- mkdumprd | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/mkdumprd b/mkdumprd index 35f5eed..ef598ed 100644 --- a/mkdumprd +++ b/mkdumprd @@ -51,7 +51,7 @@ add_dracut_sshkey() {
# caller should ensure $1 is valid and mounted in 1st kernel to_mount() { - local _dev=$1 _source _target _fstype _options _mntopts _pdev + local _dev=$1 _source _target _fstype _options _mntopts _pdev _noauto
_source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(get_mntpoint_from_target $_dev) @@ -82,8 +82,17 @@ to_mount() { # drop nofail or nobootwait _options=$(echo $_options | sed 's/(^|,)nofail($|,)/\1/g') _options=$(echo $_options | sed 's/(^|,)nobootwait($|,)/\1/g') - # only mount the dump target when needed. - _options="$_options,noauto" + + # only mount the dump target when needed by kdump.sh + _noauto=1 + if [[ $_fstype == "nfs"* ]]; then + if [[ $_fstype != "nfs4" ]] && [[ $_options != *",vers=4"* ]]; then + # If dump target is nfs with version < 4, noauto won't work as + # dracut will stop rpc server before starting kdump.sh + unset _noauto + fi + fi + [[ $_noauto ]] && _options="$_options,noauto"
_mntopts="$_target $_fstype $_options" #for non-nfs _dev converting to use udev persistent name