Boot debugging: Difference between revisions
(→See also: rm see also links not strictly related to article or duplicated) |
(→netconsole: moved to netconsole) |
||
Line 45: | Line 45: | ||
== Advanced methods == | == Advanced methods == | ||
== See also == | == See also == |
Revision as of 20:08, 12 December 2015
A lot happens during the boot process, so it is a common time for errors to manifest. There are many methods for diagnosing and fixing boot problems but most of them involve changing the kernel parameters and rebooting the system. Ensure that you are familiar with how to change your kernel parameters.
Console Clearing
If all you want is to be able to see error messages that are already being displayed, you should disable clearing of boot messages.
Debug output
Most kernel messages are hidden during boot. You can see more of these messages by adding different kernel parameters. The simplest ones are:
debug
enables debug messages for both the kernel and systemdignore_loglevel
forces all kernel messages to be printed
Other parameters you can add that might be useful in certain situations are:
earlyprintk=vga,keep
prints kernel messages very early in the boot process, in case the kernel would crash before output is shown. You must changevga
toefi
for EFI systemslog_buf_len=16M
allocates a larger (16MB) kernel message buffer, to ensure that debug output is not overwritten
There are also a number of separate debug parameters for enabling debugging in specific subsystems e.g. bootmem_debug
, sched_debug
. Check the kernel parameter documentation for specific information.
Recovery shells
Getting an interactive shell at some stage in the boot process can help you pinpoint exactly where and why something is failing. There are several kernel parameters for doing so, but they all launch a normal shell which you can exit
to let the kernel resume what it was doing:
rescue
launches a shell shortly after the root filesystem is remounted read/writeemergency
launches a shell even earlier, before most filesystems are mountedinit=/bin/sh
(as a last resort) changes the init program to a root shell.rescue
andemergency
both rely on systemd, but this should work even if systemd is broken
Another option is to enable debug-shell.service
, which adds a root shell on tty9
(accessible with Ctrl+Alt+F9). Take care to disable the service when done to avoid the security risk of leaving a root shell open on every boot.
Advanced methods
See also
- Memtest86+
- List of Tools for UBCD - Can be added to custom menu.lst like memtest
- Wikipedia's page on BIOS Boot partition
- QA/Sysrq - Using sysrq
- systemd documentation: Debug Logging to a Serial Console
- How to Isolate Linux ACPI Issues