You are not logged in.

#1 2021-03-05 18:39:55

Maniaxx
Member
Registered: 2014-05-14
Posts: 757

[Solved]kexec: No /proc/vmcore folder on Arch kernel?

Edit: I will keep the original post below in case it might be helpful for someone.
Why is there no /proc/vmcore folder on Arch? Neither on main nor capture kernel.

Solution:
/proc/vmcore is a file not a folder and only present in capture kernel.
And 'makedumpfile' doesn't seem to support the current kernel (5.11.2) atm. That's why there's no file in /var/crash generated. I thought the culprit would be /proc/vmcore being absent.

get_mm_sparsemem: Can't get the address of mem_section.
The kernel version is not supported.
The makedumpfile operation may be incomplete.

makedumpfile Failed.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hallo,
i'm trying to create a kdump after kernel panic as stated in the wiki.
https://wiki.archlinux.org/index.php/Kdump

I'm not compiling any kernel as the prerequisites of the mainline kernel are already met (correct me if i'm wrong). The default kernel/initramfs files are used as main and capture kernel.

$ zgrep -E 'CONFIG_DEBUG_INFO=|CONFIG_CRASH_DUMP=|CONFIG_PROC_VMCORE=' /proc/config.gz
CONFIG_CRASH_DUMP=y
CONFIG_PROC_VMCORE=y
CONFIG_DEBUG_INFO=y

Grub entry (with crashkernel=128M):
Edit: Needs at least crashkernel=256M

menuentry 'Arch Linux (with kdump)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'arch-kdump' {
	savedefault
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt6'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  11111111-1111-1111-1111-111111111111
	else
	  search --no-floppy --fs-uuid --set=root 11111111-1111-1111-1111-111111111111
	fi
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=UUID=11111111-1111-1111-1111-111111111111 rw crashkernel=128M threadirqs nvidia-drm.modeset=1
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/initramfs-linux.img
}

/etc/systemd/system/kdump.service (started on boot, status ok):

[Unit]
Description=Load dump capture kernel
After=local-fs.target

[Service]
ExecStart=/usr/bin/kexec -p /boot/vmlinuz-linux --initrd=/boot/initramfs-linux.img --append="root=UUID=11111111-1111-1111-1111-111111111111 systemd.unit=kdump-save.service irqpoll nr_cpus=1 reset_devices"
Type=oneshot

[Install]
WantedBy=multi-user.target

/etc/systemd/system/kdump-save.service:

[Unit]
Description=Create dump after kernel crash
DefaultDependencies=no
Wants=local-fs.target
After=local-fs.target

[Service]
Type=idle
ExecStart=/bin/sh -c 'mkdir -p /var/crash/ && /usr/bin/makedumpfile -c -d 31 /proc/vmcore "/var/crash/crashdump-$$(date +%%F-%%T)"'
ExecStopPost=/usr/bin/systemctl reboot
UMask=0077
StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit

Now the following happens:
Triggering a panic (echo c > /proc/sysrq-trigger) on tty1 shows a backtrace only and the system freezes. The capture kernel doesn't get started. When i instead unload the capture kernel (kexec -pu) and start it manually the main kernel gets shutdown by systemd first and the capture kernel gets started properly.
Edit: Fixed by crashkernel=256M

kexec /boot/vmlinuz-linux --initrd=/boot/initramfs-linux.img --append="root=UUID=11111111-1111-1111-1111-111111111111 single irqpoll nr_cpus=1 reset_devices"

- "-p" removed (for immediate kernel start)
- boot target changed from 'systemd.unit=kdump-save.service' to 'single'

In the capture kernel (and the main kernel as well) there is no /proc/vmcore folder. I'm not sure if this is intended and the folder only appears on a panic though.

The questions are:
Why can i manually start the capture kernel but on panic it doesn't work?
Is the /proc/vmcore theory correct and the folders appears on panic only?

Edit: I've increased 'crashkernel' to 256M. Now panic works but still no /proc/vmcore.

Last edited by Maniaxx (2021-03-06 01:05:14)


sys2064

Offline

Board footer

Powered by FluxBB