On 02/03/15 at 04:19pm, Baoquan He wrote:
On 02/03/15 at 02:35pm, Minfei Huang wrote:
> The crash dump is saved in the /sysroot/crash directory, not the
> /sysroot/var/crash in the atomic system.
>
> On Atomic "findmnt /var" returns following.
>
> bash-4.2# findmnt -k -n -r -o SOURCE /var
> /dev/mapper/atomicos-root[/ostree/deploy/rhel-atomic-host/var]
>
> Looks like first part is device and path inside brackets [] is path
> which is source of bind mount.
>
> So we can determine the bind mounted directory, if the "findmnt /var"
> returns contains the brackets [].
Well, patch looks good. While it's not easy to understand from log and
code change.
yeah. The Atomic is so specific.
>
> bash-4.2# findmnt -k -n -r -o SOURCE /var
> /dev/mapper/atomicos-root[/ostree/deploy/rhel-atomic-host/var]
>
The patch would determine the bind mounted directory according to the
above information.
Thanks
Minfei
>
> Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
> ---
> kdump-lib.sh | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/kdump-lib.sh b/kdump-lib.sh
> index a20c6e8..abd5467 100755
> --- a/kdump-lib.sh
> +++ b/kdump-lib.sh
> @@ -86,9 +86,20 @@ get_root_fs_device()
> return
> }
>
> +# We are looking to see if a part of dump path is mounted on some disk.
> +# But we don't want to look for bind mounted directories. By default
> +# df $path will show entries even if some part of path is bind mounted.
> +# Also run findmnt to figure out if part of the $path is actuallly bind
> +# mounted or real mount on some device.
> get_mntpoint_from_path()
> {
> - echo $(df $1 | tail -1 | awk '{print $NF}')
> + local _mnt=$(df $1 | tail -1 | awk '{print $NF}')
> + _mnt=$(findmnt -k -n -r -o SOURCE $_mnt)
> + if `echo $_mnt | grep -q "\[.*\]"`; then
> + echo "/"
> + else
> + echo $_mnt
> + fi
> }
>
> get_target_from_path()
> --
> 1.9.3
>
> _______________________________________________
> kexec mailing list
> kexec(a)lists.fedoraproject.org
>
https://lists.fedoraproject.org/mailman/listinfo/kexec