kexec (lightning talk)

9
kexec/kdump: reboot rapid s , i debug postmortem Matei Conovici [email protected] RLUG Meeting, Decembrie 2009

Upload: asociatia-prolinux

Post on 06-Jul-2015

442 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: kexec (lightning talk)

kexec/kdump: reboot rapid s, i

debug postmortem

Matei Conovici

[email protected]

RLUG Meeting, Decembrie 2009

Page 2: kexec (lightning talk)

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

Page 3: kexec (lightning talk)

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

Page 4: kexec (lightning talk)

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

Page 5: kexec (lightning talk)

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

Page 6: kexec (lightning talk)

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

Page 7: kexec (lightning talk)

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

Page 8: kexec (lightning talk)

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

Page 9: kexec (lightning talk)

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