kexec (lightning talk)
TRANSCRIPT
kexec/kdump: reboot rapid s, i
debug postmortem
Matei Conovici
RLUG Meeting, Decembrie 2009
kexec
• apel sistem pentru ıncarcarea ın memorie s, i lansarea ın execut, ie
a unui nou kernel, fara a restarta sistemul ın modul tradit, ional
• utilitar pentru controlul acestei facilitat, i
# kexec -l /vmlinuz --initrd=/initrd.img --reuse-cmdline
# kexec -e
1kexec/kdump: reboot rapid s, i debug postmortemMatei ConoviciRLUG Meeting, Decembrie 2009
Sumar al opt, iunilor:
scrat:~# kexec -h
Usage: kexec [OPTION]... [kernel]
Directly reboot into a new kernel
-h, --help Print this help.
-v, --version Print the version of kexec.
-f, --force Force an immediate kexec,
don’t call shutdown.
-l, --load Load the new kernel into the
current kernel.
-p, --load-panic Load the new kernel for use on panic.
-u, --unload Unload the current kexec target kernel.
-e, --exec Execute a currently loaded kernel.
1-1
Supported kernel file types and options:
elf-x86
--append=STRING Set the kernel command line to STRING
--reuse-cmdline Use kernel command line from running
system.
--initrd=FILE Use FILE as the kernel’s initial ramdisk.
--args-linux Pass linux kernel style options
--args-elf Pass elf boot notes
Architecture options:
--serial=<port> Specify the serial port for
debug output
--serial-baud=<baud_rate> Specify the serial port baud rate
--console-vga Enable the vga console
--console-serial Enable the serial console
1-2
Utilizare
• In Debian GNU/Linux, pachetul kexec-tools instaleaza scrip-
turile de init necesare pentru reboot
• In /etc/default/kexec se alege daca la reboot se foloses, te kexec
# Load a kexec kernel (true/false)
LOAD KEXEC=true
2kexec/kdump: reboot rapid s, i debug postmortemMatei ConoviciRLUG Meeting, Decembrie 2009
Pro/Con
• Se evita timpii mort, i la boot, mai ales cu unele BIOS-uri
enervante
• Nu toate driverele pot sa aduca dispozitivele ıntr-o stare sufi-
cient de consistenta pentru a porni “la cald”
3kexec/kdump: reboot rapid s, i debug postmortemMatei ConoviciRLUG Meeting, Decembrie 2009
kdump
• In cazul unei erori fatale ın kernel, ın loc de halt sau reboot
acesta poate apela kexec pentru a lansa un nou kernel
• Noul kernel ruleaza ıntr-un spat, iu de memorie rezervat in pre-
alabil
• Dupa pornire se poate investiga cont, inutul memoriei RAM a
kernelului anterior
4kexec/kdump: reboot rapid s, i debug postmortemMatei ConoviciRLUG Meeting, Decembrie 2009
kdump
• Kernel-ul ”standard” trebuie sa rezerve spat, iu pentru ”dump-
capture” kernel
append="... crashkernel=64M@16M ..."
• Se ıncarca ın memorie kernelul ”dump-capture”
# kexec -p /vmlinuz --initrd=/initrd.img --reuse-cmdline
• Se as, teapta urmatorul PANIC :-)
• Cont, inutul memoriei RAM este expus ın /proc/vmcore sau
/dev/oldmem
5kexec/kdump: reboot rapid s, i debug postmortemMatei ConoviciRLUG Meeting, Decembrie 2009
kdump
• Cateva opt, iuni necesare ın configurat, ia kernel-ului:
CONFIG KEXEC, CONFIG CRASH DUMP, CONFIG PROC VMCORE ...
• Vezi /usr/src/linux/Documentation/kdump/kdump.txt
6kexec/kdump: reboot rapid s, i debug postmortemMatei ConoviciRLUG Meeting, Decembrie 2009