Linux Troubleshooting
Precautions
Have a rescue disk or flash drive :
Either a live-session copy of your current distro, on USB, or:
Rescatux & Super Grub2 Disk
Boot-Repair-Disk
Ubuntu's "Boot-Repair"
GParted Live (login as "user" / "live")
Finnix
SystemRescueCd
Grml Live Linux
LinuxAndUbuntu's "Top 5 Linux System Rescue CDs"
Martins D. Okoi's "12 Useful Rescue and Recovery Tools for Linux"
Hard-core: CAINE (Computer Aided Investigative Environment)
The time to make rescue disks is before you have a problem, not after.<br>If your hard disk is encrypted, test how you would access (decrypt) the disk<br>when you've booted from a live-session on USB stick. Also test booting from hard disk<br>into GRUB recovery.
You may have to disable Secure Boot to run some of these.
Have standard live-session USB images you can boot :
Sometimes you just need to get to a normal Linux system (not a rescue<br>disk) to analyze your damaged OS on main disk.
Have SSH access to the system :
If you set up SSH access ahead of time, then you have a way to connect<br>to a system even if GUI login fails, and you can examine log files and maybe fix things.
Have backups of system configuration details :
I run a script:<br>SaveConfig.sh
Have notes, passwords, alternatives, etc on other devices :
My web site contains a lot of the knowledge and commands I'd need to use.<br>My phone has a copy of my password manager, and<br>access to my email accounts.
Disconnect extra disks any time you're going to do something dangerous :
If you have removable disks A and B, and you want to format B, first disconnect A.
Problems and troubleshooting
In general:
What did you change before the problem happened ?
Is there an error message ? Search for solutions to it.
[If you're not using English, switch to English and get the message again,<br>because searching for the English message is far more likely to give results.]
Are there any logs that will help ? "journalctl", and maybe in /var/log.
Maybe install "lnav" (video).
"systemctl --failed".
What can you remove to simplify the situation ?
What can you vary to test the situation ? Specific to one app, or happens in all apps ?
Reboot and see if it still happens ?
Put explanation of the problem, error message, and logs into an LLM and see what it says.
If can't install Linux :
Using correct ISO (legacy BIOS vs. UEFI, Secure Boot vs. not, MBR vs. GPT, 64-bit vs. 32-bit) ?
In BIOS, try turning off Secure Boot.
In BIOS, try setting SATA to AHCI.
Create bootable USB image again, maybe copying failed.
Try using a different USB stick.
Try using Ventoy.
If install freezes part-way, try a different mirror for the package manager.
Try installing a different Linux distro.
If disk decryption password not accepted :
Keyboard map set correctly ?
CapsLock ?
Correct password ?
Prefix password with several backspaces to make sure buffer is empty.
Boot from live session on USB and then:
Test keyboard by typing password into a text file.
Run cryptsetup luksOpen with --debug to get more information.
Check journal for any kernel or device-mapper errors.
If the system won't boot :
If system boots to a GRUB prompt:
Maybe something changed boot device order in BIOS.
Maybe something changed "UEFI" versus "legacy" in BIOS.
Maybe something changed Secure Boot setting in BIOS.
Maybe you're accidentally trying to boot from a USB stick ?
"If your system stops at grub prompt, it means GRUB is functional, but its configuration is missing or incorrect."
CloudNetOps' "How to Fix GRUB Boot Issues in Linux"
GRUB section of my Linux Boot Process page
To force booting to a GRUB prompt:
If legacy BIOS system, hold down Shift while booting.
If UEFI system, press Escape while booting.
If system boots to a GRUB-rescue prompt:
"If your system drops to grub-rescue prompt, it means GRUB is unable to locate its core files."
Dave McKay's "How to Use GRUB Rescue to Fix Linux"
CloudNetOps' "How to Fix GRUB Boot Issues in Linux"
If system boots to an "(initramfs)" prompt<br>(BusyBox):
See<br>article1,<br>article2.
"Booting into initramfs usually means that the system couldn't mount the root filesystem."
Maybe make a backup (if possible) before doing any repair operations.
Maurits van der Schee's "LUKS recovery from initramfs shell"
If system boots to an empty black screen before login screen:
Do Ctrl+Alt+F2 to see if you can get a text login prompt and login to<br>a CLI console. Check what filesystems are mounted, are any mounted read-only, etc.<br>"systemctl --failed".
To have system show everything it does as it boots, (in GRUB ??? type "linux" ???) get to menu that shows<br>list of kernels, select a kernel, press "e" to edit that entry.<br>Remove 'rhgb quiet' [Red Hat specific] or 'quiet' [other Linux] and then boot from that kernel.<br>Note: the edits will affect just the next boot, they won't be permanent.<br>Note: you may not see a prompt for the FDE password, the output may just stop at<br>that point until you type the...