how to use kexec to jump back to the original kernel

Bhupesh SHARMA bhupesh.linux at gmail.com
Tue Feb 13 11:06:39 PST 2018


On Tue, Feb 13, 2018 at 8:15 PM, Gioh Kim <gurugio at gmail.com> wrote:
> On Tue, Feb 13, 2018 at 3:36 PM, Gioh Kim <gurugio at gmail.com> wrote:
>> On Tue, Feb 13, 2018 at 11:06 AM, Gioh Kim <gurugio at gmail.com> wrote:
>>> On Mon, Feb 12, 2018 at 7:56 AM, Bhupesh SHARMA <bhupesh.linux at gmail.com> wrote:
>>>> Hello,
>>>>
>>>> On Fri, Feb 9, 2018 at 7:24 PM, Gioh Kim <gurugio at gmail.com> wrote:
>>>>> Hello,
>>>>>
>>>>> "echo c > /proc/sysrq-trigger" generates the kernel dump but it
>>>>> reboots the system.
>>>>> I'd like to generate kernel dump without system reboot.
>>>>>
>>>>> I think it is possible to jump to the kdump kernel and generate kernel
>>>>> dump, and come back to the operating kernel with kexec.
>>>>> I know I can jump to the kdump kernel with "kexec -e" but I cannot
>>>>> figure out how to come back to the operating kernel.
>>>>>
>>>>> For example, I tried following sequences after reading kexec manual page.
>>>>>
>>>>> 0. rebuild kernel with CONFIG_KEXEC_JUMP option
>>>>> 1. kexec --load=/boot/vmlinuz --initrd=/boot/initrd --reuse-cmdline
>>>>
>>>> Instead you should be using something like:
>>>> # kexec -l /boot/vmlinuz-`uname -r` --initrd=/boot/initramfs-`uname
>>>> -r`.img --reuse-cmdline  --load-preserve-context --mem-min=addr
>>>> --mem-max=addr
>>>
>>> Hello Bhupesh,
>>
>> I'm sorry to bother you.
>> I failed because I booted up wrong kernel without KEXEC_JUMP.
>> I can jump to kdump kernel with booting a kernel with KEXEC_JUMP.
>> And I can see "kexec_jump_back_entry=0x00000000000810d2" at kernel
>> booting parameter.
>> Now I can jump to kdump kernel and jump back to the original kernel.
>>
>> Can I ask just one more question?
>> After jumping to kdump kernel, there is not /proc/vmcore file.
>> I checked the kernel enabled CONFIG_PROC_VMCORE option.
>> What kernel option should I enable to use /proc/vmcore?
>> Or should I use another file instead /proc/vmcore?
>>
>>
>
> I'm sorry but please let me ask one more question.
>
> I ran "kexec -e" command on kdump kernel, then it just rebooted the system.
> I guess jumping to the original kernel means resuming the original
> kernel as it was running.
> Did I misunderstand?
> Or my machine did not work correctly?

Hello,

I have replied in another thread (in reply to the documentation patch
for kdump jump feature which you sent out today) about this in detail,
but to capture my thoughts briefly here, I think you are confusing the
'kexec -l' or loading another kernel and 'kexec -p' or the kdump use
cases.

Can you please explain whether you are trying the jump feature with
'kexec -l' or 'kexec -p'.

I remember trying the jump feature with 'kexec -p' some time back and
it did not work for me at that time. Although I was able to use the
jump feature with 'kexec -l' on the same machine.

Regards,
Bhupesh



More information about the kexec mailing list