Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ tags:
- rescue
---

# How to deal with a kernel panic
## Introduction

Sometimes a kernel installation goes wrong and you have to backtrack.

There can be many reasons for this: insufficient space on the `/boot` partition, an interrupted installation or some kind of problem with a third-party application.
There can be many reasons for this: insufficient space on the `/boot` partition, an interrupted installation, or some kind of problem with a third-party application.

Fortunately for us, there's always something we can do to save the day.
Fortunately for us, there is always something we can do to save the day.

## Try to reboot with the previous kernel

First thing to try is to reboot with the previous kernel.

* Restart the system.
* Restart the system.
* Once you have reached the GRUB 2 boot screen, move the selection to the menu entry corresponding to the previous kernel and press the `enter` key.

Once the system has restarted, it can be repaired.
Expand All @@ -30,11 +30,11 @@ If the system does not boot, try the **rescue mode** (see above).

## Uninstall the broken kernel

The easiest way to do this is to uninstall the kernel version that's not working and then reinstall it.
The easiest way to do this is to uninstall the kernel version that is not working and then reinstall it.

!!! NOTE
!!! Note

You can't remove a kernel that you are running.
You cannot remove a kernel that you are running.

To show the version of currently running kernel:

Expand Down Expand Up @@ -72,39 +72,39 @@ or use the `dnf repoquery` command:
dnf remove $(dnf repoquery --installed --installonly --latest=1)
```

You can now upgrade your system to try to reinstall the latest kernel version.
You can now upgrade your system and try reinstalling the latest kernel version.

```bash
dnf update
```

Reboot and see if this time, the new kernel works!
Reboot and see if the new kernel works this time.

## Rescue mode

Rescue mode corresponds to the old single-user mode.

!!! NOTE
!!! Note

To enter in rescue mode, you have to provide the root password.

To enter rescue mode, the easiest way is to select the line starting with `0-rescue-*` in the grub menu.

Another way is to edit any line of the grub menu (pressing 'e' key) and add `systemd.unit=rescue.target` at the end of the line that starts with `linux` and then press `ctrl+x` to boot the system into rescue mode.

!!! NOTE
!!! Note

You are then in qwerty mode.

Once you are in rescue mode and you have enter the root password, you can then repair your system.

For that, you may need to configure a temporary IP address thanks to `ip ad add ...` (see network chapter of our admin guide).
For that, you might need to configure a temporary IP address thanks to `ip ad add ...` (see network chapter of our admin guide).

## Last chance: Anaconda Rescue Mode

If none of the above methods work, it's still possible to boot from the installation ISO and repair the system.
If none of the above methods work, it is still possible to boot from the installation ISO and repair the system.

This method is not covered by this documentation.
This method is not covered by this documentation.

## System maintenance

Expand All @@ -124,6 +124,6 @@ We can limit the number of kernel versions by editing the `/etc/yum.conf` file a
installonly_limit=3
```

!!! NOTE
!!! Note

You should always keep at least the latest kernel version and a backup version.