From 5e85d20d344f2013b69a5680e72bbf7b2cbb0f97 Mon Sep 17 00:00:00 2001 From: Dave Young Date: Mon, 23 Jul 2012 15:31:22 +0800 Subject: [PATCH] use fstab-sys to mount nfs dump_nfs mount the nfs share to /mnt, it's not what we expected. Change to use dracut fstab mount infrastructure for this. After the fix nfs dump is just same as localfs dump. The --mount for nfs does not work before, it depend on the upstream patch: 1. dracut fix to autoload nfs.ko in case nfs4. the patch post as below: http://permalink.gmane.org/gmane.linux.kernel.initramfs/2768 Signed-off-by: Dave Young Acked-by: Vivek Goyal --- dracut-kdump.sh | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/dracut-kdump.sh b/dracut-kdump.sh index eb4cbe1..144cc88 100755 --- a/dracut-kdump.sh +++ b/dracut-kdump.sh @@ -126,17 +126,6 @@ dump_rootfs() sync } -dump_nfs() -{ - mount -o remount,rw $NEWROOT/ || return 1 - [ -d $NEWROOT/mnt ] || mkdir -p $NEWROOT/mnt - mount -o nolock -o tcp -t nfs $1 $NEWROOT/mnt/ || return 1 - mkdir -p $NEWROOT/mnt/$KDUMP_PATH/$DATEDIR || return 1 - $CORE_COLLECTOR /proc/vmcore $NEWROOT/mnt/$KDUMP_PATH/$DATEDIR/vmcore || return 1 - umount $NEWROOT/mnt/ || return 1 - return 0 -} - dump_ssh() { local _opt="-i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes" @@ -225,7 +214,7 @@ read_kdump_conf() if [[ "$config_val" =~ "@" ]]; then add_dump_code "dump_ssh $SSH_KEY_LOCATION $config_val" else - add_dump_code "dump_nfs $config_val" + add_dump_code "dump_fs $config_val" fi ;; esac