On 03/04/15 at 01:07am, Minfei Huang wrote:
Enhance kdump to support bind mounted target, since kdump cann't parse the bind mounted path.
Following is the testcases which kdump can generate the core sucessfully.
- rootfs, default path / specified path
- rootfs with bind mounted path which is in the rootfs device # cat /etc/kdump | grep ^path path /var/crash # mount -o bind /var/crash /mnt/crash
- rootfs with bind mounted path which is not in the rootfs device # cat /etc/kdump | grep ^path path /var/crash # mount /dev/vdb /mnt # mount -o bind /var/crash /mnt/crash
- no-rootfs
- no-rootfs with bind mounted path which is in the same device
- no-rootfs with bind mounted path which is not in the same device
- nfs
- nfs with bind mounted path which is under the nfs mount point path # cat /etc/kdump | grep ^nfs nfs 192.168.122.134:/opt/crash # cat /etc/kdump | grep ^path path /var/crash # mount.nfs 192.168.122.134:/opt/crash /mnt/nfs # mount -o bind /mnt/nfs/var/crash /mnt/nfs/dump
- nfs with bind mounted path which is not under the nfs mount point path # cat /etc/kdump | grep ^nfs nfs 192.168.122.134:/opt/crash # cat /etc/kdump | grep ^path path /var/crash # mount.nfs 192.168.122.134:/opt/crash /mnt/nfs # mount -o bind /mnt/nfs/var/crash /mnt/dump
- nfs which don't specify the nfs option in the /etc/kdump, with bind mounted path which is under the nfs mount point path # cat /etc/kdump | grep ^nfs # mount.nfs 192.168.122.134:/opt/crash /mnt/nfs # cat /etc/kdump | grep ^path path /mnt/nfs/var/crash # mount -o bind /mnt/nfs/var/crash /mnt/nfs/dump
- nfs which don't specify the nfs option in the /etc/kdump, with bind mounted path which is not under the nfs mount point path # cat /etc/kdump | grep ^nfs # mount.nfs 192.168.122.134:/opt/crash /mnt/nfs # cat /etc/kdump | grep ^path path /mnt/nfs/var/crash # mount -o bind /mnt/nfs/var/crash /mnt/dump
- ext4
- ext4 with bind mounted path which is under the ext4 mount point path
- ext4 with bind mounted path which is not under the ext4 mount point path
- btrfs
- btrfs with subvolume which mounts under mount point path
- btrfs with subvolume which does not mount under mount point path
Minfei Huang (4): kdump-lib: Add new function to cut out the substring kdump-lib: Add the new function to enhance bind mounted judgement kdump-lib: Get the mount point correctly, if the device has several mount point dracut-module-setup: Fix the incorrect dumping target, if the path is bind mounted
dracut-module-setup.sh | 49 +++++++++++++++++++++++++++++++++++----- kdump-lib.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++++++- mkdumprd | 32 +++++++++++++++++++------- 3 files changed, 128 insertions(+), 14 deletions(-)
There's some problems ie. umount original directory and only keep bind mounted one.
The cases looks complicated, I agree with Bao that it increases code complexity dramaticlly so how about do it like below:
1) document that we do not support bind mount 2) for atomic, two ways to resolve the problem: *) they can pack a different kdump.conf with different default path *) we can fix it by conditionally set default path for atomic
Thanks Dave