[Patch v4 3/6] pass mount info to dracut when default target is a separate disk

Martin Milata mmilata at redhat.com
Fri Mar 28 13:01:15 UTC 2014


Hi,

do I understand it correctly that kdump will be able to automatically
mount the filesystem(s) needed to access "path" if no partition is
specified?

With regards to s-c-kdump, would it be sufficient to enable setting the
"Path" textbox even when no partition is chosen in the "Partition" drop
down menu? Does the path need some addition validation?

Is this change targeted at RHEL6/RHEL7/Fedora?

Thank you,
Martin

On Fri, Mar 28, 2014 at 16:39:11 +0800, Baoquan He wrote:
> Hi,
> 
> As Vivek previously suggested, I looked into the s-c-kdump setup. If the
> path which is mounted on by separate fs can be supported to be set as
> dump target, s-c-kdump is OK with it. The only thing is the save_path,
> it can not be changed when no disk is specified.
> 
> Now in s-c-kdump, there are 3 sections in "target setting" tab. For
> "Local Filesystem", user can select any separate disk which exist in
> current system, meanwhile specify a save_path. If "Partition" is "None",
> then "Path" would be "/var/crash" by default. Other 2 choices are "Raw
> device" and "Network".
> 
> For now, if both path with separate fs and explicitly specified dump
> target are supported, s-c-kdump may need be changed a little. E.g when
> "Partition" is "None", user can specify any "Path" which they have
> created. They decicde if a suitable fs is mounted on that "Path" so that
> a separate fs is used to store the dump vmcore or rootfs is used to
> store the dump. 
> 
> Thanks
> Baoquan
> 
> On 03/21/14 at 05:55pm, Baoquan He wrote:
> > When user does not specify dump target explicitly, it's better to
> > dump to the "path" specified. That means after dump user enter into
> > 1st kernel, can find vmcore in the "path". If that path is in root
> > fs, vmcore is stored in root fs. If separate disk is mounted on
> > any tier of "path", we just dump vmcore into the left path on the
> > left separate disk.
> > 
> > E.g in kdump.conf
> > path /mnt/nfs
> > 
> > in mount info,
> > /dev/vdb on /mnt type ext4 (rw,relatime,seclabel,data=ordered)
> > 
> > Then vmcore will be saved in /nfs of /dev/vdb.
> > 
> > In this patch, pass mount info to dracut in this case if separate
> > disk is mounted on any tier of "path".
> > 
> > Meanwhile introduce a function in kdump-lib.sh to check if any
> > target is specified.
> > 
> > Signed-off-by: Baoquan He <bhe at redhat.com>
> > Acked-by: Vivek Goyal <vgoyal at redhat.com>
> > ---
> >  kdump-lib.sh | 14 ++++++++++++++
> >  mkdumprd     | 34 +++++++++++++++++++---------------
> >  2 files changed, 33 insertions(+), 15 deletions(-)
> > 
> > diff --git a/kdump-lib.sh b/kdump-lib.sh
> > index 6c90ed5..d2562d1 100755
> > --- a/kdump-lib.sh
> > +++ b/kdump-lib.sh
> > @@ -53,6 +53,20 @@ get_user_configured_dump_disk()
> >      return
> >  }
> >  
> > +is_user_configured_dump_target()
> > +{
> > +    local _target
> > +
> > +    if is_ssh_dump_target || is_nfs_dump_target; then
> > +        return 0
> > +    fi
> > +
> > +    _target=$(egrep "^ext[234]|^xfs|^btrfs|^minix|^raw" /etc/kdump.conf 2>/dev/null |awk '{print $2}')
> > +    [ -n "$_target" ] && return 0
> > +
> > +    return 1
> > +}
> > +
> >  get_root_fs_device()
> >  {
> >      local _target
> > diff --git a/mkdumprd b/mkdumprd
> > index c8333a3..6916de4 100644
> > --- a/mkdumprd
> > +++ b/mkdumprd
> > @@ -325,25 +325,29 @@ get_block_dump_target()
> >      [ -b "$_target" ] && echo $(to_dev_name $_target)
> >  }
> >  
> > -# If no dump disk is specified make sure /var/crash is not mounted on a
> > -# separate disk.
> > -check_block_dump_target()
> > +#handle the case user does not specify the dump target explicitly
> > +handle_default_dump_target()
> >  {
> >      local _target
> >      local _mntpoint
> > +    local _fstype
> >  
> > -    _target=$(get_user_configured_dump_disk)
> > -    [ -n "$_target" ] && return
> > +    is_user_configured_dump_target && return
> >  
> > -    _target=$(get_root_fs_device)
> > -    if [ -b "$_target" ]; then
> > -        mkdir -p $SAVE_PATH
> > -        _mntpoint=`df $SAVE_PATH | tail -1 |  awk '{print $NF}'`
> > -        if [ "$_mntpoint" != "/" ]; then
> > -            perror "No dump target specified. Default dump target is rootfs block device."
> > -            perror "But dump path $SAVE_PATH is not backed by rootfs block device. "
> > -            perror_exit "Either explicitly specify a dump target or specify a dump path backed by rootfs block device"
> > +    check_save_path_fs $SAVE_PATH
> > +
> > +    _mntpoint=$(get_mntpoint_from_path $SAVE_PATH)
> > +    _target=$(get_target_from_path $SAVE_PATH)
> > +    if [ "$_mntpoint" != "/" ]; then
> > +        SAVE_PATH=${SAVE_PATH##"$_mntpoint"}
> > +        _fstype=$(get_fs_type_from_target $_target)
> > +
> > +        if [ "$_fstype" = "nfs" ]; then
> > +            add_dracut_module "nfs"
> >          fi
> > +
> > +        add_mount "$_target"
> > +        check_size fs $_target
> >      fi
> >  }
> >  
> > @@ -470,8 +474,6 @@ check_crypt()
> >      return 1
> >  }
> >  
> > -check_block_dump_target
> > -
> >  if ! check_resettable; then
> >      exit 1
> >  fi
> > @@ -549,6 +551,8 @@ do
> >      esac
> >  done < $conf_file
> >  
> > +handle_default_dump_target
> > +
> >  if [ -n "$extra_modules" ]
> >  then
> >      add_dracut_arg "--add-drivers" "$extra_modules"
> > -- 
> > 1.8.5.3
> > 


More information about the kexec mailing list