On 04/05/17 at 04:10pm, Xunlei Pang wrote:
On 03/31/2017 at 02:11 PM, Dave Young wrote:
> On 03/31/17 at 01:03pm, Xunlei Pang wrote:
>> On 03/31/2017 at 12:52 PM, Pratyush Anand wrote:
>>>
>>> On Thursday 30 March 2017 01:40 PM, Xunlei Pang wrote:
>>>> Since the current dracut of Fedora already supports not always
>>>> mounting root device, we can remove "root=X" from the command
>>>> line directly, and always get the dump target specified in
>>>> "/etc/kdump.conf" and mount it. If the dump target is located
>>>> at root filesystem, we will add the root mount info explicitly
>>>> from kdump side instead of from dracut side.
>>>>
>>>> For example, in case of nfs/ssh/usb/raw/etc(non-root) dumping,
>>>> kdump will not mount the unnecessary root fs after this change.
>>>>
>>>> This patch removes "root=X" via the
"KDUMP_COMMANDLINE_REMOVE"
>>>> (if "default dump_to_rootfs" is specified, don't remove
"root=X"),
>>>> and mounts non-root target under "/kdumproot", the root
target
>>>> still under "/sysroot"(to be align with systemd
sysroot.mount).
>>>>
>>>> After removing "root=X", we now add root fs mount information
>>>> explicitly from the kdump side.
>>>>
>>>> Changed check_dump_fs_modified() a little to avoid rebuild when
>>>> dump target is root, since we add root fs mount explicitly now.
>>>>
>>>> Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
>>>> ---
>>>> kdumpctl | 33 ++++++++++++++++++++++++++++-----
>>>> mkdumprd | 29 +++++++++--------------------
>>>> 2 files changed, 37 insertions(+), 25 deletions(-)
>>>>
>>>> diff --git a/kdumpctl b/kdumpctl
>>>> index 01a2ad8..0fb5e7b 100755
>>>> --- a/kdumpctl
>>>> +++ b/kdumpctl
>>>> @@ -171,6 +171,11 @@ check_kdump_cpus()
>>>> echo " try nr_cpus=$nr_min or larger instead"
>>>> }
>>>>
>>>> +is_dump_to_rootfs()
>>>> +{
>>>> + grep "^default[[:space:]]dump_to_rootfs" /etc/kdump.conf
>/dev/null
>>>> +}
>>>> +
>>>> # This function performs a series of edits on the command line.
>>>> # Store the final result in global $KDUMP_COMMANDLINE.
>>>> prepare_cmdline()
>>>> @@ -192,6 +197,19 @@ prepare_cmdline()
>>>> # These params can be removed configurably
>>>> cmdline=`remove_cmdline_param "$cmdline"
${KDUMP_COMMANDLINE_REMOVE}`
>>>>
>>>> + # Always remove "root=X", as we now explicitly generate
all kinds
>>>> + # of dump target mount information including root fs. But we keep
>>>> + # it if "default dump_to_rootfs" is specified(non-root
dumping).
>>>> + #
>>>> + # We do this before KDUMP_COMMANDLINE_APPEND, if one really care
>>>> + # about it(e.g. for debug purpose), then can pass
"root=X" using
>>>> + # KDUMP_COMMANDLINE_APPEND.
>>>> + #
>>>> + # Don't remove "root=X" in case of fadump?
>>> Better to check for != "fadump" then.
>> Will update, thanks!
> Another concern is about iscsi, I found dracut supports root=iscsi:...
> There are username, passwd etc, although in theory we have code to
> detect iscsi luns it should work, but most of the test cases are iscsi
> disk as root device, root iscsi depends on root= cmdline. So I worry
> that non-root iscsi was not tested well, so not sure if we can assemble
> iscsi disk correctly after dropping root=.
>
> So we either test it and confirm or just not to strip root= for
> iscsi case as well.
For iscsi as non-root devices, removing "root=X" doesn't matter.
For iscsi as root device cases
1) For full offload HBA
hardware does everything for us, the iscsi device is just like we operate a local
disk.
2) For iBFT or OF iscsi
dracut will also generate "ip=ibft" and "rd.iscsi.firmware=1" in
"--hostonly-cmdline"
mode, although Fedora doesn't have this, it will inherit them from the 1st
kernel
cmdline. As for the "root=X", it does not care.
3) For software iscsi
I setup a software iscsi environment, and did some tests(also read some code),
it turns out that it doesn't matter. As kdump will generate
"netroot=iscsi:xxx"
and add the device we added to /etc/fstab, dracut 95iscsi::iscsiroot.sh will take
care of "netroot=XXX" without "root=X".
Thanks for the verification, I think iscsi should be fine according to
your above test..
I met one issue on Fedora during software iscsi tests, it's
related to "x-initrd.mount"
we discussed last week. When testing on RHEL7, it works well with my patches.
We can continue discuss "x-initrd.mount" issue in the old thread, anyway a
separate
issue.
Thus, I think we can safely strip "root=" for iscsi cases.
Besides, there are also NBD, rhel7 doesn't support NBD, I think we can ignore that
on
Fedora as well. As for NFS root we can always rely on /etc/fstab, all the things can be
correctly handled during mount, there is nothing wrong after we remove
"root=X"(I
setup a nfs root environment and confirmed that).
For NFS root as long as findmnt works it should also work in kdump
initrd so it should be safe
Thanks
Dave