On 03/26/15 at 05:56pm, Baoquan He wrote:
On 03/26/15 at 05:48pm, Minfei Huang wrote:
> On 03/26/15 at 05:32pm, Baoquan He wrote:
> > On 03/26/15 at 05:19pm, Minfei Huang wrote:
> > You are right that we can allways get the root mount point in
> > > /dev/mapper/atomicos-root in atomic, if we use the command "findmnt
-k
> > > -n -r -o TARGET /dev/mapper/atomicos-root".
> > >
> > > But I think maybe we shall leave the hint how we can get the root mount
> > > point correctly, if the target device is not /dev/mapper/atomicos-root,
> > > or the os is not atomic. Otherwise it may be hard to be fixed.
> >
> > What do you mean? Here the code just do the device mounting. whatever
> > the mount poing is, it will be mounted in 2nd kernel.
> >
> > And then with the correct dump path, e.g on /dev/sda, it will surely
> > dump to the parsed real dump path on /dev/sda. what is mount point
> > doesn't matter.
> >
>
Could you paste each mount info of them? I don't get what you mean here
about crash and /dev/vda/crash.
sure.
Here is the mount info for /dev/vda.
[root@localhost ~]# mount | grep /dev/vda
/dev/vda on /crash type ext4 (rw,relatime,seclabel,data=ordered)
/dev/vda on /mnt type ext4 (rw,relatime,seclabel,data=ordered)
The directory tree is:
[root@localhost ~]# ls /mnt/
lost+found var
[root@localhost ~]# ls /mnt/var/
crash
[root@localhost ~]# ls /mnt/var/crash/
[root@localhost ~]#
> The command "findmnt -k -n -r -o TARGET /dev/mapper/atomicos-root" does
> not always return the "/" firstly. Here is an example.
>
> The directory /crash is a bind mounted directory, and "/mnt" is the
> mount point of device /dev/vda.
>
> [root@localhost 99kdumpbase]# findmnt -k -n -r -o TARGET /dev/vda
> /crash
> /mnt
> [root@localhost 99kdumpbase]# findmnt /crash
> TARGET SOURCE FSTYPE OPTIONS
> /crash /dev/vda[/var/crash] ext4 rw,relatime,seclabel,data=ordered
We can see that /crash is a bind mounted direcotry which points to /var/crash.
> [root@localhost 99kdumpbase]# findmnt /mnt
> TARGET SOURCE FSTYPE OPTIONS
> /mnt /dev/vda ext4 rw,relatime,seclabel,data=ordered
>
> If we specify the kdump.conf as following, a warning will be raised in
> function get_fs_size.
>
> kdump.conf
> ext4 /dev/vda
> path /var/crash
If the kdump.conf is specified like above, the abosolute path for target is
/mnt/var/crash.
Thanks
Minfei
>
> The target path is /mnt/var/crash, not the /crash/var/crash.
>
> Thanks
> Minfei
>
> > >
> > > Thanks
> > > Minfei
> > >
> > > > On 03/04/15 at 01:07am, Minfei Huang wrote:
> > > > > The filesystem support the device to be mounted different mount
points.
> > > > > The root path in the device may be different, if the mount point
is
> > > > > mounted by bind mode. In order to dump core correctly, we should
find
> > > > > the root path in the device.
> > > > >
> > > > > Following is the case that device is mounted by bind mode.
> > > > >
> > > > > TARGET SOURCE FSTYPE OPTIONS
> > > > > /mnt/ext4 /dev/vda btrfs rw,relatime,seclabel,space_cache
> > > > > TARGET SOURCE FSTYPE OPTIONS
> > > > > /mnt/bind-dir /dev/vda[/var] btrfs
rw,relatime,seclabel,space_cache
> > > > >
> > > > > We can find that /mnt/bind-dir is mounted in the path
/dev/vda[/var], in
> > > > > the other word, the /mnt/bind-dir points to the /var directory
in the
> > > > > /dev/vda.
> > > > > The /mnt/ext4 is the root path in the device.
> > > > >
> > > > > Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
> > > > > ---
> > > > > kdump-lib.sh | 7 ++++++-
> > > > > mkdumprd | 8 ++------
> > > > > 2 files changed, 8 insertions(+), 7 deletions(-)
> > > > >
> > > > > diff --git a/kdump-lib.sh b/kdump-lib.sh
> > > > > index 74b3c1c..4301eb4 100755
> > > > > --- a/kdump-lib.sh
> > > > > +++ b/kdump-lib.sh
> > > > > @@ -135,7 +135,12 @@ get_fs_type_from_target()
> > > > >
> > > > > get_mntpoint_from_target()
> > > > > {
> > > > > - echo $(findmnt -k -f -n -r -o TARGET $1)
> > > > > + for _mnt in $(findmnt -k -n -r -o TARGET $1)
> > > > > + do
> > > > > + if ! is_bind_mount $_mnt; then
> > > > > + echo $_mnt
> > > > > + fi
> > > > > + done
> > > > > }
> > > > >
> > > > > # get_option_value <option_name>
> > > > > diff --git a/mkdumprd b/mkdumprd
> > > > > index a8f9cbb..7fdcebf 100644
> > > > > --- a/mkdumprd
> > > > > +++ b/mkdumprd
> > > > > @@ -100,7 +100,7 @@ to_mount() {
> > > > > local _dev=$1 _source _target _fstype _options _mntopts
_pdev
> > > > >
> > > > > _source=$(findmnt -k -f -n -r -o SOURCE $_dev)
> > > > > - _target=$(findmnt -k -f -n -r -o TARGET $_dev)
> > > > > + _target=$(get_mntpoint_from_target $_dev)
> > > > > # mount under /sysroot if dump to root disk or mount under
> > > > > #/kdumproot/$_target in other cases in 2nd kernel. systemd
> > > > > #will be in charge to umount it.
> > > > > @@ -144,10 +144,6 @@ to_mount() {
> > > > > echo "$_pdev $_mntopts"
> > > > > }
> > > > >
> > > > > -to_mount_point() {
> > > > > - echo $(findmnt -k -f -n -r -o TARGET $1)
> > > > > -}
> > > > > -
> > > > > is_readonly_mount() {
> > > > > local _mnt
> > > > > _mnt=$(findmnt -k -f -n -r -o OPTIONS $1)
> > > > > @@ -201,7 +197,7 @@ mkdir_save_path_ssh()
> > > > > #Function: get_fs_size
> > > > > #$1=dump target
> > > > > get_fs_size() {
> > > > > - local _mnt=$(to_mount_point $1)
> > > > > + local _mnt=$(get_mntpoint_from_target $1)
> > > > > echo -n $(df -P "${_mnt}/$SAVE_PATH"|tail -1|awk
'{print $4}')
> > > > > }
> > > > >
> > > > > --
> > > > > 1.9.3
> > > > >
> > > > > _______________________________________________
> > > > > kexec mailing list
> > > > > kexec(a)lists.fedoraproject.org
> > > > >
https://lists.fedoraproject.org/mailman/listinfo/kexec
> > > _______________________________________________
> > > kexec mailing list
> > > kexec(a)lists.fedoraproject.org
> > >
https://lists.fedoraproject.org/mailman/listinfo/kexec
> _______________________________________________
> kexec mailing list
> kexec(a)lists.fedoraproject.org
>
https://lists.fedoraproject.org/mailman/listinfo/kexec