diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh index 6eaec93..41dc751 100755 --- a/kdump-lib-initramfs.sh +++ b/kdump-lib-initramfs.sh @@ -101,15 +101,8 @@ get_fs_type_from_target() get_mntpoint_from_target() { - local SOURCE TARGET - findmnt -k --pairs -o SOURCE,TARGET "$1" | while read line; do - eval "$line" - # omit sources that are bind mounts i.e. they contain a [/path/to/subpath]. - if [[ ! "$SOURCE" =~ \[ ]]; then - echo $TARGET - break - fi - done + # --source is applied to ensure non-bind mount is returned + get_mount_info TARGET source "$1" -f } is_ssh_dump_target() diff --git a/kdump-lib.sh b/kdump-lib.sh index 28ee6c0..0ccabc0 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -213,7 +213,7 @@ get_bind_mount_source() _fsroot=${_src#${_src_nofsroot}[} _fsroot=${_fsroot%]} - _mnt=$(get_mntpoint_from_target "$_src_nofsroot") + _mnt=$(get_mount_info TARGET source "$_src_nofsroot" -f) # for btrfs, _fsroot will also contain the subvol value as well, strip it if [[ $_fstype == btrfs ]]; then