7.6. Diagnosing Boot and Hardware Failures
A boot failure leaves evidence in several places: the firmware and boot
loader may print to the console, the kernel writes to its ring buffer, the
initramfs may stop in a shell, and systemd records which units failed. The
first task is to determine which layer was reached. This section starts with
the journal because it survives a successful boot and is available after the
fact, then covers a failed mount, the missing-root case, and the
driver-regression workflow.
7.6.1. Kernel Messages and Previous-Boot Journals
journalctl can list the boots it has retained. Each boot has an index
relative to the current boot and a boot ID:
# journalctl --list-boots --no-pager | tail -n 6
-5 d9375bc1ef9e4f0498128eaca3d6efbd Thu 2026-11-19 03:30:20 UTC Thu 2026-11-19 03:31:02 UTC
-4 53ece2331dd14db1b1b247ede1f73088 Thu 2026-11-19 03:31:10 UTC Thu 2026-11-19 03:31:47 UTC
-3 f0cc0718578747948794bce61bd2fdad Thu 2026-11-19 03:31:56 UTC Thu 2026-11-19 04:24:57 UTC
-2 f60e73ae9f22419daffa11ab2df865c7 Thu 2026-11-19 04:25:06 UTC Thu 2026-11-19 04:25:56 UTC
-1 ec89c6d4a10f4f4da5dc5194eb26128e Thu 2026-11-19 04:26:04 UTC Thu 2026-11-19 04:26:44 UTC
0 8548ad2c83574d94bae67ac08a0923c5 Thu 2026-11-19 04:26:53 UTC Thu 2026-11-19 04:33:24 UTC
0 is the current boot, -1 is the previous one, and so on; the boot ID is
the stable identifier for scripts that need to refer to a specific boot. The
current boot is not necessarily the one that failed: after a crash or a
power loss, the failed attempt may be -1 or earlier, while 0 is the
recovery boot. A negative index is relative to the current boot, so it
changes as new boots are recorded. Table 7.17 lists the selectors used in
this section.
| Option | Description |
|---|---|
-b [N] |
Select the current boot, a relative index such as -1, or a boot ID. |
-k |
Show kernel messages only. |
-p PRIORITY |
Show messages at or above a priority, such as err or warning. |
-u UNIT |
Restrict to one unit. |
--since / --until |
Restrict by time. |
-o FORMAT |
Select an output format such as short-monotonic. |
--no-pager |
Print directly instead of opening a pager. |
-x |
Add explanatory text for some messages. |
Kernel messages from the previous boot show which kernel and which command line were used:
# journalctl -k -b -1 --no-pager | head -n 12
Nov 19 04:26:04 trixie kernel: Linux version 6.12.86+deb13-amd64 (debian-kernel@lists.debian.org) (x86_64-linux-gnu-gcc-14 (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44) #1 SMP PREEMPT_DYNAMIC Debian 6.12.86-1 (2026-05-08)
Nov 19 04:26:04 trixie kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-6.12.86+deb13-amd64 root=UUID=be225267-eaf4-410c-9ffa-5cd32b221ce0 ro consoleblank=0 elevator=noop scsi_mod.use_blk_mq=Y net.ifnames=0 biosdevname=0
Nov 19 04:26:04 trixie kernel: BIOS-provided physical RAM map:
Nov 19 04:26:04 trixie kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
Nov 19 04:26:04 trixie kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
Nov 19 04:26:04 trixie kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
Nov 19 04:26:04 trixie kernel: BIOS-e820: [mem 0x0000000000100000-0x000000003ffdafff] usable
Nov 19 04:26:04 trixie kernel: BIOS-e820: [mem 0x000000003ffdb000-0x000000003fffffff] reserved
Nov 19 04:26:04 trixie kernel: BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
Nov 19 04:26:04 trixie kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
Nov 19 04:26:04 trixie kernel: NX (Execute Disable) protection: active
Nov 19 04:26:04 trixie kernel: APIC: Static calls initialized
The -k flag limits the output to kernel messages, -b -1 selects the
previous boot, and --no-pager keeps the text in the terminal. This is the
fastest way to prove which kernel ran in the previous boot, rather than the
new kernel that the default entry would have chosen.
Errors from the previous boot are selected by priority. -p err includes
errors and more severe messages, but not warnings:
# journalctl -b -1 -p err --no-pager | tail -n 8
Nov 19 04:26:05 trixie systemd-ssh-generator[246]: Failed to query local AF_VSOCK CID: Cannot assign requested address
Nov 19 04:26:05 trixie (sd-exec-[238]: /usr/lib/systemd/system-generators/systemd-ssh-generator failed with exit status 1.
Nov 19 04:26:07 trixie systemd-udevd[311]: /usr/lib/udev/rules.d/90-alsa-restore.rules:18 GOTO="alsa_restore_std" has no matching label, ignoring.
Nov 19 04:26:07 trixie systemd-udevd[311]: /usr/lib/udev/rules.d/90-alsa-restore.rules:22 GOTO="alsa_restore_std" has no matching label, ignoring.
Not every error is a boot failure. The systemd-ssh-generator message is
about the absence of an AF_VSOCK device in this virtual machine, and the ALSA
rule warnings come from a package's udev rules; neither prevented the system
from reaching its target. The journal is a record, not a verdict. Correlate a
message with the time at which the boot stopped and with the unit or device
it names before treating it as the cause.
The current boot's warnings can be compared with the previous boot's. The
-p warning selector includes warnings, errors, and more severe levels; the
tail shows recent entries:
# journalctl -k -b --no-pager -p warning | tail -n 6
Nov 19 04:26:53 trixie kernel: ---[ end trace 0000000000000000 ]---
Nov 19 04:26:53 trixie kernel: scsi_mod: unknown parameter 'use_blk_mq' ignored
Nov 19 04:26:53 trixie systemd-ssh-generator[244]: Failed to query local AF_VSOCK CID: Cannot assign requested address
Nov 19 04:26:53 trixie (sd-exec-[236]: /usr/lib/systemd/system-generators/systemd-ssh-generator failed with exit status 1.
Nov 19 04:26:57 trixie kernel: kauditd_printk_skb: 46 callbacks suppressed
Nov 19 04:29:01 trixie kernel: ch07_hello: loading out-of-tree module taints kernel.
The ch07_hello line is the DKMS module from Section 7.3.3; it remains in
the boot log after the module is removed, which is why the log records what
happened rather than merely what is loaded now. The
scsi_mod: unknown parameter 'use_blk_mq' ignored line is a concrete
configuration defect. The parameter is still in the kernel command line
because it was added to /etc/default/grub.d/10_cloud_disk_scheduler.cfg;
the running kernel no longer supports the parameter and warns that it is
ignoring it. The
fix is to remove scsi_mod.use_blk_mq=Y from that drop-in, run
update-grub, and reboot. The warning is harmless in itself, but it is
evidence that the boot configuration contains a stale option, which is
exactly the kind of thing to clean up before attributing a boot problem to a
driver.
The journal's persistence depends on /var/log/journal. If that directory
exists, systemd writes the journal to disk and --list-boots can show older
boots; if it does not, the journal is volatile and only the current boot is
available. Chapter 8 covers the journal's storage, rotation, and forwarding
configuration. For a failed boot, the console output and the kernel ring
buffer may be the only evidence if the journal was never written.
7.6.2. Failed Mounts, Missing Root Devices, and Emergency Mode
A mount failure outside the root filesystem is a useful, contained way to see
how systemd represents a missing device. The demonstration adds a temporary
/etc/fstab entry for a UUID that does not exist. Back up the file first,
because a bad fstab can prevent the next boot:
# cp /etc/fstab /root/ch07-fstab.backup
The command is silent. Add the test line:
# printf "%s\n" "UUID=00000000-0000-0000-0000-000000000000 /srv/handbookdata ext4 defaults,x-systemd.device-timeout=2s 0 2" | tee -a /etc/fstab
UUID=00000000-0000-0000-0000-000000000000 /srv/handbookdata ext4 defaults,x-systemd.device-timeout=2s 0 2
The x-systemd.device-timeout=2s keeps the demonstration short; without it
the default device timeout can be much longer. Create the mount point and ask
systemd to regenerate its units from the edited file:
# mkdir -p /srv/handbookdata
# systemctl daemon-reload
Both commands are silent. Starting the generated mount unit fails because its device unit cannot become active:
# systemctl start srv-handbookdata.mount
A dependency job for srv-handbookdata.mount failed. See 'journalctl -xe' for details.
The status output shows the generated unit, the missing device, and the inactive state:
# systemctl status srv-handbookdata.mount --no-pager | head -n 10
○ srv-handbookdata.mount - /srv/handbookdata
Loaded: loaded (/etc/fstab; generated)
Active: inactive (dead)
Where: /srv/handbookdata
What: /dev/disk/by-uuid/00000000-0000-0000-0000-000000000000
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
Nov 19 04:33:44 trixie systemd[1]: Dependency failed for srv-handbookdata.mount - /srv/handbookdata.
Nov 19 04:33:44 trixie systemd[1]: srv-handbookdata.mount: Job srv-handbookdata.mount/start failed with result 'dependency'.
The mount unit never became active, so it is inactive rather than failed.
systemctl --failed consequently lists nothing:
# systemctl --failed --no-pager
UNIT LOAD ACTIVE SUB DESCRIPTION
0 loaded units listed.
This is a subtle but important distinction. A failed job is not the same as
a failed unit: the start job failed because a dependency failed, and the
mount unit's own state remained inactive. The dependency failure is recorded
in the journal and in the status output. When diagnosing a boot that hung on a
mount, look for the device unit and the mount job, not only for units in the
failed state. Figure 7.4 shows the relationship.
Figure 7.4. systemd-fstab-generator turns an fstab line into a device unit
and a mount unit. A missing device fails the dependency job; the mount unit
stays inactive, so systemctl --failed may not list it.
Restore the original file and reload:
# cp /root/ch07-fstab.backup /etc/fstab
# systemctl daemon-reload
Both are silent. The generated unit is no longer defined; asking for it now reports that it cannot be found:
# systemctl status srv-handbookdata.mount --no-pager
Unit srv-handbookdata.mount could not be found.
Remove the backup and confirm that no failed units remain:
# rm -f /root/ch07-fstab.backup
# systemctl --failed --no-pager
UNIT LOAD ACTIVE SUB DESCRIPTION
0 loaded units listed.
The empty /srv/handbookdata directory can be removed with
rmdir /srv/handbookdata once the fstab line is gone.
The same pattern occurs at boot, with a more serious outcome. A mount listed
in /etc/fstab without nofail is wanted by local-fs.target; if its device
does not appear within the timeout, local-fs.target fails and the boot falls
to emergency mode. The system is then at a root shell on the console, with
most services stopped and the root filesystem mounted read-only. A mount with
nofail is allowed to fail without blocking the boot, and
x-systemd.automount can defer the mount until something accesses the path.
Use nofail for removable or nonessential data, not for a filesystem that
contains /var or /home, where continuing without it would corrupt the
system's state.
A missing root device is a different failure. The initramfs cannot mount
/, so it stops in its own rescue shell, normally identified by an
(initramfs) prompt. The exact prompt and available commands depend on the
initramfs generator; initramfs-tools provides a small rescue shell with
blkid, cat, mount, fsck, and a limited set of other tools. At that
shell, run cat /proc/cmdline to see the root= value, blkid to list the
visible filesystems and UUIDs, and fsck /dev/vda1 (with the correct device)
if the device exists but the mount failed. This path requires
console access; a remote SSH session is not available because the network and
sshd have not started. The recovery steps are to
verify the root=UUID=... value, check that the disk is visible, run a
filesystem check if the device exists but the mount failed, and then exit
to retry the boot with corrected parameters. If the UUID is wrong, boot the
previous kernel or edit the GRUB entry at the menu and supply the correct
root= value. If the initramfs lacks the storage driver, boot a kernel with
a more complete initramfs, or rebuild the initramfs from a rescue system.
rescue.target and emergency.target are the systemd equivalents for a
system that has mounted / but cannot complete the normal boot.
rescue.target starts a single-user environment with most services stopped;
emergency.target is more minimal and mounts / read-only. Both are selected
with systemd.unit= on the kernel command line or with systemctl isolate
from an already running system. They require a root password or console
access, so they are not a remote-only recovery method. Chapter 16 covers the
rescue media and the full recovery workflow; the boot-time distinction is
what matters here: a failure before systemd needs the initramfs or boot
loader, while a failure after systemd starts can often be repaired from
rescue.target.
Do not edit /etc/fstab without a backup and a tested way to boot. The
mount -a command applies the file to the running system and is a useful
pre-flight check, but it does not prove that the next boot will succeed: a
device that is present now may be absent later. The nofail and
x-systemd.device-timeout= options are part of the design, not cosmetic
flags.
7.6.3. Driver Regressions and Boot Parameter Troubleshooting
A driver regression usually appears as a device that worked before a kernel update and stopped afterward. The first check is whether the module exists for the running kernel. An explicit load of a nonexistent module gives a precise error and names the module directory:
# modprobe ch07_missing_driver
modprobe: FATAL: Module ch07_missing_driver not found in directory /lib/modules/6.12.117+deb13-amd64
The message distinguishes a missing module from a module that exists but
fails to load. modinfo can inspect a module that does exist, and depmod -a
can rebuild the module dependency database if a package installation was
interrupted. A module that is present but refuses to load usually reports a
version mismatch, a missing symbol, or a firmware error in the kernel log;
journalctl -k -b | grep -i -E 'firmware|module|taint' is a useful filter,
and the lines it prints depend on the driver. If the device worked with the
previous kernel, the fastest comparison is to boot that kernel and inspect
the same messages. The grub-reboot procedure
from Section 7.3.2 selects the old kernel for one boot; journalctl -k -b -1
then shows the messages from the new kernel's failed attempt, while
journalctl -k -b 0 shows the old kernel that is currently running. Compare
the driver name, the firmware file, and the device probe order. A regression
in a storage driver is more serious than one in a Wi-Fi driver because it can
prevent the root filesystem from mounting; in that case the initramfs shell or
a rescue system is the only route in.
Kernel parameters are the other common variable. A parameter can be added for
one boot from the GRUB menu, or persistently with a drop-in and update-grub
as in Section 7.2.1. The test performed there used two parameters with
different purposes:
$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-6.12.117+deb13-amd64 root=UUID=be225267-eaf4-410c-9ffa-5cd32b221ce0 ro consoleblank=0 elevator=noop scsi_mod.use_blk_mq=Y net.ifnames=0 biosdevname=0 handbook.lab=1 systemd.unit=multi-user.target
handbook.lab=1 was ignored by the kernel, as an unknown parameter normally
is; systemd.unit=multi-user.target was consumed by systemd and prevented the
graphical target from being reached. The persistent default remained
graphical.target, and systemd printed a note explaining the override. This
is a safe way to test a boot parameter: make one change, reboot, inspect the
running command line and the target, then remove the change and reboot again.
Do not combine several unrelated parameters in one test unless you are
prepared to attribute the result to one of them.
The boot-time troubleshooting parameters are summarized in Table 7.18. They are diagnostic tools, not permanent configuration. A system that needs one of them to boot every time has a configuration problem that should be fixed.
| Parameter | Use and caution |
|---|---|
systemd.unit=multi-user.target |
Boot without the graphical session; useful when a display manager blocks the boot. |
systemd.unit=rescue.target |
Single-user repair mode; needs console access. |
systemd.unit=emergency.target |
Minimal repair mode with / read-only; needs console access. |
nomodeset |
Disable kernel mode setting for graphics debugging; the display may be limited. |
modprobe.blacklist=module |
Skip a suspect module for one boot. |
init=/bin/bash |
Bypass systemd entirely; a last resort that leaves / read-only and most services absent. |
panic=10 |
Reboot after a panic instead of waiting; useful on unattended systems, dangerous during diagnosis. |
A stale parameter is as much a defect as a missing one. The
scsi_mod.use_blk_mq=Y warning from the current kernel is a real example: the
option was valid in an older kernel and is now ignored. The fix is to remove
it from the drop-in, run update-grub, and verify the warning is gone after
the next boot. The same approach applies to a parameter that was added for a
device that is no longer present. Keep the kernel command line short and
document why each non-default parameter exists; a future administrator will
otherwise be afraid to remove it.
Finally, systemd-analyze and the journal are complementary.
systemd-analyze blame shows which units took the most time, while
journalctl -b shows what they were waiting for. A slow boot caused by a
missing mount will show the device unit in blame and the dependency failure
in the journal; a slow boot caused by a service will show the service in
blame and its own log lines in the journal. Use both before changing
anything, and record the before-and-after timings so that a change can be
evaluated rather than guessed at.