Recover from Boot Failures
It can be quite distressing when a computer fails to boot up normally! Here are some recovery mechanisms:
Roll back to an older version of the operating system (OS)
If the boot failure started happening after you updated the system, rolling back to the older version will generally fix it.
To do this:
- Power on or restart the machine.
- Hold down Space until the OS version chooser appears (in white text in the center of the screen, against a black background).
- Press the down arrow key once to select the prior OS version, or a different one.
- Press Enter to boot into it.
If this fixes the issue, please report it at https://invent.kde.org/kde-linux/kde-linux/-/issues/, and attach the output of running journalctl --boot -1 --no-pager in a terminal window.
Boot the system in a different way by changing the kernel command line
If that does not work, you can change how the system boots by altering the kernel command line parameters to achieve various debugging approaches.
To edit the kernel command line:
- Power on or restart the machine.
- Hold down Space until the OS version chooser appears (in white text in the center of the screen, against a black background).
- Press the e key.
- A text field with very long text in it will appear; this is the kernel command line.
Disable systemd extensions
Add systemd.mask=systemd-sysext.serviceto the kernel command line and then press Enter.
This is useful if you have any systemd extensions active, and the boot failure started happening after you updated the content in any of them; this could be the cause. Temporarily disabling extensions should resolve the issue until you can debug what’s wrong with it.
If this works, after logging in, debug what’s wrong with the extension and fix it. If you are unable to, disable it.
Bypass issues with the login screen or Plasma
Add systemd.unit=multi-user.target to the kernel command line and then press Enter.
This is useful if the login screen or plasma are failing to start or crashing in a loop; you can boot into a command-line environment that will bypass both of them, within which debugging is possible.
If debugging and troubleshooting determines that the problem was not caused by your own actions, open a bug report for the KDE Linux team to investigate.
Enter the emergency root shell
- Add
systemd.debug_shell=on SYSTEMD_SULOGIN_FORCE=1to the kernel command line and press Enter. - Wait for the screen to turn black and stay that way for a few seconds.
- Press Ctrl+Alt+F9 (note: on a laptop, you may also have to hold down Fn).
You are now in the emergency root shell. Every command you run will be executed as root, so be careful.
If debugging and troubleshooting determines that the problem was not caused by your own actions, open a bug report for the KDE Linux team to investigate.
Roll back /etc
It’s possible for /etc to be modified when booted into a particular build in a way that makes it incompatible with older builds.
This can manifest as bizarre issues after rolling back the OS, such as black screens or login passwords not being accepted.
To recover, replace the broken /etc with an older, working one as follows:
- Get a shell via either of the above methods and run the following commands:
sudo mv /etc /etc.brokensudo btrfs subvolume snapshot $(ls -d -1 /.etc.* | tail -2 | head -1) /etcsystemctl reboot
These manual steps should become unnecessary once https://invent.kde.org/kde-linux/kde-linux/-/issues/505 is implemented.
Article contributed by Nate Graham under the CC-BY-4.0 license.