# /proc/vmcore not found

## Lok

How to dump kernel log?

# cat /proc/vmcore

cat: /proc/vmcore: No such file or directory

# cat /proc/cmdline

BOOT_IMAGE=/boot/kernel-genkernel-x86_64-4.12.5-gentoo root=UUID=b5d861b7-8985-40c4-953d-3eefd34624b6 ro crashkernel=64M

# zcat /proc/config.gz |grep -i kexec

CONFIG_KEXEC_CORE=y

CONFIG_KEXEC=y

# CONFIG_KEXEC_JUMP is not set

# zcat /proc/config.gz |grep -i vmcore

CONFIG_PROC_VMCORE=y

----------

## eccerr0r

I'm not sure I understand what you're asking...

vmcore is the crash dump of the last kernel that you used, as recovered by kexec'ed recovery kernel.  This is for fairly advanced users, but I can't tell if this is what you want by your question.  I wouldn't call it a "log", more of a crash memory dump.

If you mean old kernel-generated text warning/error logs, it depends on what you've or what the kernel could have saved.  If you have syslogd installed, usually what's emitted from the kernel is logged in /var/log/messages.  For systemd, the command journalctl has everything saved.

----------

## Lok

Ok,

how to dump kernel by kexec?

# cat /proc/cmdline           

BOOT_IMAGE=/boot/kernel-genkernel-x86_64-4.12.5-gentoo root=UUID=b5d861b7-8985-40c4-953d-3eefd34624b6 ro crashkernel=64M

# kexec -p /boot/kernel-genkernel-x86_64-4.12.5-gentoo --initrd=/boot/initramfs-genkernel-x86_64-4.12.5-gentoo --append="root=/dev/sda3 single irqpoll maxcpus=1 reset_devices dolvm softlevel=kdump"

Unknown type (Reserved) while parsing /sys/firmware/memmap/17/type. Please report this as bug. Using RANGE_RESERVED now.

Unknown type (Reserved) while parsing /sys/firmware/memmap/7/type. Please report this as bug. Using RANGE_RESERVED now.

Unknown type (Reserved) while parsing /sys/firmware/memmap/5/type. Please report this as bug. Using RANGE_RESERVED now.

Unknown type (Reserved) while parsing /sys/firmware/memmap/3/type. Please report this as bug. Using RANGE_RESERVED now.

Unknown type (Reserved) while parsing /sys/firmware/memmap/21/type. Please report this as bug. Using RANGE_RESERVED now.

Unknown type (Reserved) while parsing /sys/firmware/memmap/1/type. Please report this as bug. Using RANGE_RESERVED now.

Unknown type (Reserved) while parsing /sys/firmware/memmap/18/type. Please report this as bug. Using RANGE_RESERVED now.

Unknown type (Reserved) while parsing /sys/firmware/memmap/16/type. Please report this as bug. Using RANGE_RESERVED now.

Unknown type (Reserved) while parsing /sys/firmware/memmap/14/type. Please report this as bug. Using RANGE_RESERVED now.

Unknown type (Reserved) while parsing /sys/firmware/memmap/20/type. Please report this as bug. Using RANGE_RESERVED now.

Unknown type (Reserved) while parsing /sys/firmware/memmap/10/type. Please report this as bug. Using RANGE_RESERVED now.

Unknown type (Reserved) while parsing /sys/firmware/memmap/19/type. Please report this as bug. Using RANGE_RESERVED now.

ELF core (kcore) parse failed

Cannot load /boot/kernel-genkernel-x86_64-4.12.5-gentoo

#

----------

## eccerr0r

The kexec is done by the kernel itself when it detects a crash.  If everything is setup properly, just cause a kernel crash (could sysrq-c) and it should kexec the recovery kernel and the vmdump will show up.

----------

## Lok

Not work

kernel config https://pastebin.com/GrGKiaEW

# cat /etc/conf.d/kexec|grep -vE "^#"

ROOTPART="/dev/sda3"

KNAME="kernel-4"

INITRD="initramfs-4"

DONT_MOUNT_BOOT="yes"

# cat /etc/kexec.conf|grep -vE "^#"

KNAME="kernel-4"

KEXEC_OPT_ARGS="--initrd=initramfs-4"

# cat /proc/cmdline                  

BOOT_IMAGE=/boot/kernel-genkernel-x86_64-4.12.5-gentoo root=UUID=b5d861b7-8985-40c4-953d-3eefd34624b6 ro crashkernel=64M

But after reboot start new kernel

rc.log: kexec              | * Using kernel image /boot/kernel-4 (with /boot/initramfs-4) for kexec ...

# cat /sys/kernel/kexec_loaded       

0

# /etc/init.d/kexec restart        

kexec              | * WARNING: you are stopping a boot service

kexec              | * Not rebooting; disabling kexec ...                                                                                              [ ok ]

sysrq-c -- system freeze, and kernel not start.

----------

## eccerr0r

Okay I can't explain things better than https://wiki.gentoo.org/wiki/Kernel_Crash_Dumps

----------

## Lok

Thank you,

Apparently something with kexec, because I can load and start the kernel fine with the -l and -e options, but -p doesn’t seem to trigger.

----------

