[PATCH 0/2 v7] Add early kdump support in initramfs.
by Lianbo Jiang
Kdump service starts too late, so early crashes will have no chance
to get kdump kernel booting, this will cause crash information to be
lost. It is necessary to add a dracut module in order to load crash
kernel and initramfs as early as possible. You can provide "rd.early
kdump" in grub commandline to enable, then the early kdump will load
those files like the normal kdump, which is disabled by default.
For the normal kdump service, it can check whether the early kdump
has loaded the crash kernel and initramfs. It has no conflict with
the early kdump.
If you rebuild the new initramfs for early kdump, the new initramfs
size will become large, because it will put the vmlinuz and kdump
initramfs into the new initramfs.
In addition, early kdump doesn't support fadump.
Finally, we move some common functions from kdumpctl to kdump-lib.sh,
the functions could be used in other modules, such as early kdump. It
has no bad effect.
Some changes based the patch v5:
1.dracut-early-kdump-module-setup.sh
-Introduce some variables to parse parameters for kernel commandline
and initrd.
-It will use "dracut --add earlykdump --force" to rebuild the new
initramfs for the early kdump.
-install some commands, such as tail, find, dirname, hexdump, cut.
-modify code style.
2.early-kdump-howto.txt
-update the usage about the early kdump.
3.kdump-lib.sh
-add comment for some functions.
-modify check_boot_dir() function.
-modify code style.
4.dracut-early-kdump.sh
-modify prepare_parameters() function and handle the case with
a "KDUMP_KERNELVER" setting.
Some changes based the patch v6:
1.early-kdump-howto.txt
-modify the description about earlykdump usage steps.
2.dracut-early-kdump-module-setup.sh
-delete 'split' command.
Lianbo Jiang (2):
move some common functions from kdumpctl to kdump-lib.sh
Add early kdump support in initramfs.
dracut-early-kdump-module-setup.sh | 44 ++++++++
dracut-early-kdump.sh | 84 ++++++++++++++
early-kdump-howto.txt | 54 +++++++++
kdump-lib.sh | 222 +++++++++++++++++++++++++++++++++++++
kdumpctl | 211 +----------------------------------
kexec-tools.spec | 11 ++
6 files changed, 418 insertions(+), 208 deletions(-)
create mode 100755 dracut-early-kdump-module-setup.sh
create mode 100755 dracut-early-kdump.sh
create mode 100644 early-kdump-howto.txt
--
2.9.5
5 years, 6 months
[PATCHv2] kdumpctl: add showmem cmd
by Pingfan Liu
port from rhel, original patch is contributed by Minfei Huang:
If the grub kernel commandline is set to crashkernel=auto, it will not
expand the crashkernel=auto in the /proc/cmdline. It still says
crashkernel=auto.
Using /sys to determines crashkernel actual size is confusing since
there is no unit of measure.
Add a new command "kdumpctl showmem" to show the reserved memory kindly.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdumpctl | 13 ++++++++++++-
kdumpctl.8 | 3 +++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index cebca36..1279d72 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -830,6 +830,14 @@ propagate_ssh_key()
fi
}
+show_reserved_mem()
+{
+ local mem=3D$(cat /sys/kernel/kexec_crash_size)
+ local mem_mb=3D$(expr $mem / 1024 / 1024)
+
+ echo "Reserved "$mem_mb"MB memory for crash kernel"
+}
+
handle_mode_switch()
{
if [ "$DEFAULT_DUMP_MODE" == "fadump" ]; then
@@ -1246,8 +1254,11 @@ main ()
propagate)
propagate_ssh_key
;;
+ showmem)
+ show_reserved_mem
+ ;;
*)
- echo $"Usage: $0 {start|stop|status|restart|propagate}"
+ echo $"Usage: $0 {start|stop|status|restart|propagate|showmem}"
exit 1
esac
}
diff --git a/kdumpctl.8 b/kdumpctl.8
index b446b81..023562b 100644
--- a/kdumpctl.8
+++ b/kdumpctl.8
@@ -35,6 +35,9 @@ Is equal to
.I propagate
Helps to setup key authentication for ssh storage since it's
impossible to use password authentication during kdump.
+.TP
+.I showmem
+Prints the size of reserved memory for crash kernel in megabytes.
.SH "SEE ALSO"
.BR kdump.conf (5),
--
2.7.4
5 years, 6 months
[PATCH 0/2 V6] Add early kdump support in initramfs.
by Lianbo Jiang
Kdump service starts too late, so early crashes will have no chance
to get kdump kernel booting, this will cause crash information to be
lost. It is necessary to add a dracut module in order to load crash
kernel and initramfs as early as possible. You can provide "rd.early
kdump" in grub commandline to enable, then the early kdump will load
those files like the normal kdump, which is disabled by default.
For the normal kdump service, it can check whether the early kdump
has loaded the crash kernel and initramfs. It has no conflict with
the early kdump.
If you rebuild the new initramfs for early kdump, the new initramfs
size will become large, because it will put the vmlinuz and kdump
initramfs into the new initramfs.
In addition, early kdump doesn't support fadump.
Finally, we move some common functions from kdumpctl to kdump-lib.sh,
the functions could be used in other modules, such as early kdump. It
has no bad effect.
Some changes based the patch v3&v4&v5:
1.dracut-early-kdump-module-setup.sh
-Introduce some variables to parse parameters for kernel commandline
and initrd.
-It will use "dracut --add earlykdump --force" to rebuild the new
initramfs for the early kdump.
-install some commands, such as tail, find, dirname, hexdump, cut. (*)
-modify code style. (*)
2.early-kdump-howto.txt
-update the usage about the early kdump.
3.kdump-lib.sh
-add comment for some functions.
-modify check_boot_dir() function.
-modify code style. (*)
4.dracut-early-kdump.sh
-modify prepare_parameters() function and handle the case with
a "KDUMP_KERNELVER" setting.
Lianbo Jiang (2):
move some common functions from kdumpctl to kdump-lib.sh
Add early kdump support in initramfs.
dracut-early-kdump-module-setup.sh | 44 ++++++++
dracut-early-kdump.sh | 84 ++++++++++++++
early-kdump-howto.txt | 50 +++++++++
kdump-lib.sh | 217 +++++++++++++++++++++++++++++++++++++
kdumpctl | 206 +----------------------------------
kexec-tools.spec | 11 ++
6 files changed, 409 insertions(+), 203 deletions(-)
create mode 100755 dracut-early-kdump-module-setup.sh
create mode 100755 dracut-early-kdump.sh
create mode 100644 early-kdump-howto.txt
--
2.9.5
5 years, 6 months
[PATCH] kdumpctl: Remove 'netroot' and 'iscsi initiator' entries from kdump cmdline
by Bhupesh Sharma
In a iSCSI multipath environment (which uses iSCSI software initiator
and target environment) when the vmcore file is saved on the target,
kdump always fails to establish a iSCSI session and also fails to
collect dump due to duplicate entries for 'netroot' and
'iscsi initiator' in the kdump bootargs:
# echo c > /proc/sysrq-trigger
[83471.842707] SysRq : Trigger a crash
[83471.843233] BUG: unable to handle kernel NULL pointer dereference at (null)
[83471.844155] IP: [<ffffffffac82ed16>] sysrq_handle_crash+0x16/0x20
[83471.844931] PGD 800000023f710067 PUD 229fd6067 PMD 0
[83471.845655] Oops: 0002 [#1] SMP
<snip..>
[83471.861889] Call Trace:
[83471.862162] [<ffffffffac82f53d>] __handle_sysrq+0x10d/0x170
[83471.862771] [<ffffffffac82f9af>] write_sysrq_trigger+0x2f/0x40
[83471.863405] [<ffffffffac690630>] proc_reg_write+0x40/0x80
[83471.863984] [<ffffffffac61acd0>] vfs_write+0xc0/0x1f0
[83471.864536] [<ffffffffac61baff>] SyS_write+0x7f/0xf0
[83471.865075] [<ffffffffacb1f7d5>] system_call_fastpath+0x1c/0x21
[83471.865714] Code: eb 9b 45 01 f4 45 39 65 34 75 e5 4c 89 ef e8 e2 f7 ff ff eb db 0f 1f 44 00 00 55 48 89 e5 c7 05 41 47 81 00 01 00 00 00 0f ae f8 <c6> 04 25 00 00 00 00 01 5d c3 0f 1f 44 00 00 55 31 c0 c7 05 be
[83471.868888] RIP [<ffffffffac82ed16>] sysrq_handle_crash+0x16/0x20
[83471.869700] RSP <ffff9e7fe77b7e58>
[83471.870074] CR2: 0000000000000000
<snip..>
Starting Login iSCSI Target iqn.2014-08.com.example:t1...
[ OK ] Stopped Login iSCSI Target iqn.2014-08.com.example:t1.
Starting Login iSCSI Target iqn.2014-08.com.example:t1...
[ 6.607051] scsi host2: iSCSI Initiator over TCP/IP
[FAILED] Failed to start Login iSCSI Target iqn.2014-08.com.example:t1.
See 'systemctl status "iscsistart_\\x40...com.example:t1.service"' for details.
[ 126.572911] dracut-initqueue[243]: Warning: dracut-initqueue timeout - starting timeout scripts
Stopping Open-iSCSI...
[ OK ] Stopped Open-iSCSI.
Starting Open-iSCSI...
[ OK ] Started Open-iSCSI.
Starting Login iSCSI Target iqn.2014-08.com.example:t1...
[ OK ] Stopped Login iSCSI Target iqn.2014-08.com.example:t1.
Starting Login iSCSI Target iqn.2014-08.com.example:t1...
[ 131.095897] scsi host3: iSCSI Initiator over TCP/IP
[FAILED] Failed to start Login iSCSI Target iqn.2014-08.com.example:t1.
See 'systemctl status "iscsistart_\\x40...com.example:t1.service"' for details.
[ 251.085029] dracut-initqueue[243]: Warning: dracut-initqueue timeout - starting timeout scripts
[ 251.594554] dracut-initqueue[243]: Warning: dracut-initqueue timeout - starting timeout scripts
<snip..>
This patch fixes the same by removing the 'netroot',
'rd.iscsi.initiator' and 'iscsi_initiator' entries from the kdump boot
cmdline.
Signed-off-by: Bhupesh Sharma <bhsharma(a)redhat.com>
---
kdumpctl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index cebca36a4b20..c55a5a5817db 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -138,6 +138,11 @@ prepare_cmdline()
# With the help of "--hostonly-cmdline", we can avoid some interitage.
cmdline=$(remove_cmdline_param "$cmdline" rd.lvm.lv rd.luks.uuid rd.dm.uuid rd.md.uuid fcoe)
+ # Remove netroot, rd.iscsi.initiator and iscsi_initiator since
+ # we get duplicate entries for the same in case iscsi code adds
+ # it as well.
+ cmdline=$(remove_cmdline_param "$cmdline" netroot rd.iscsi.initiator iscsi_initiator)
+
cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
id=$(get_bootcpu_apicid)
--
2.7.4
5 years, 6 months
[PATCH] kdumpctl: add showmem cmd
by Pingfan Liu
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdumpctl | 13 ++++++++++++-
kdumpctl.8 | 3 +++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 4280e7e..0f1e3ac 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -828,6 +828,14 @@ propagate_ssh_key()
fi
}
+show_reserved_mem()
+{
+ local mem=$(cat /sys/kernel/kexec_crash_size)
+ local mem_mb=$(expr $mem / 1024 / 1024)
+
+ echo "Reserved "$mem_mb"MB memory for crash kernel"
+}
+
handle_mode_switch()
{
if [ "$DEFAULT_DUMP_MODE" == "fadump" ]; then
@@ -1244,8 +1252,11 @@ main ()
propagate)
propagate_ssh_key
;;
+ showmem)
+ show_reserved_mem
+ ;;
*)
- echo $"Usage: $0 {start|stop|status|restart|propagate}"
+ echo $"Usage: $0 {start|stop|status|restart|propagate|showmem}"
exit 1
esac
}
diff --git a/kdumpctl.8 b/kdumpctl.8
index b446b81..023562b 100644
--- a/kdumpctl.8
+++ b/kdumpctl.8
@@ -35,6 +35,9 @@ Is equal to
.I propagate
Helps to setup key authentication for ssh storage since it's
impossible to use password authentication during kdump.
+.TP
+.I showmem
+Prints the size of reserved memory for crash kernel in megabytes.
.SH "SEE ALSO"
.BR kdump.conf (5),
--
2.7.4
5 years, 6 months
[PATCH 0/2 V5] Add early kdump support in initramfs.
by Lianbo Jiang
Kdump service starts too late, so early crashes will have no chance
to get kdump kernel booting, this will cause crash information to be
lost. It is necessary to add a dracut module in order to load crash
kernel and initramfs as early as possible. You can provide "rd.early
kdump" in grub commandline to enable, then the early kdump will load
those files like the normal kdump, which is disabled by default.
For the normal kdump service, it can check whether the early kdump
has loaded the crash kernel and initramfs. It has no conflict with
the early kdump.
If you rebuild the new initramfs for early kdump, the new initramfs
size will become large, because it will put the vmlinuz and kdump
initramfs into the new initramfs.
In addition, early kdump doesn't support fadump.
Finally, we move some common functions from kdumpctl to kdump-lib.sh,
the functions could be used in other modules, such as early kdump. It
has no bad effect.
Some changes based the patch v3&v4:
1.dracut-early-kdump-module-setup.sh
-Introduce some variables to parse parameters for kernel commandline
and initrd.
-It will use "dracut --add earlykdump --force" to rebuild the new
initramfs for the early kdump.
2.early-kdump-howto.txt
-update the usage about the early kdump.
3.kdump-lib.sh
-add comment for some functions.
-modify check_boot_dir() function. (*)
4.dracut-early-kdump.sh (*)
-modify prepare_parameters() function and handle the case with
a "KDUMP_KERNELVER" setting.
Lianbo Jiang (2):
move some common functions from kdumpctl to kdump-lib.sh
Add early kdump support in initramfs.
dracut-early-kdump-module-setup.sh | 42 +++++++
dracut-early-kdump.sh | 84 ++++++++++++++
early-kdump-howto.txt | 50 +++++++++
kdump-lib.sh | 217 +++++++++++++++++++++++++++++++++++++
kdumpctl | 206 +----------------------------------
kexec-tools.spec | 11 ++
6 files changed, 407 insertions(+), 203 deletions(-)
create mode 100755 dracut-early-kdump-module-setup.sh
create mode 100755 dracut-early-kdump.sh
create mode 100644 early-kdump-howto.txt
--
2.9.5
5 years, 7 months