Full Diagnostic Tree & Step-by-Step Overview
What exactly do you see on your screen when you power on your PC?
- A black screen with a 'grub rescue>' prompt (and 'error: no such partition/unknown filesystem').
- A black screen with a normal 'grub>' prompt (Minimal BASH-like line editing).
- No error, but it boots straight into Windows and bypasses Ubuntu entirely.
The `grub rescue>` prompt means GRUB is completely lost. We need to manually point it to your Ubuntu partition. Have you already tried using the `ls` command to find your partition?
- No, walk me through the manual terminal commands.
- Yes, but I got 'unknown filesystem' on every single partition, or it didn't work.
Master-Class Manual GRUB Recovery
Solution:
We can manually stitch the bootloader back together right from this prompt. Pay close attention to the spaces in these commands.
Step 1: Find your partitions
Type the following command and press Enter:
ls
*You will see an output like: (hd0) (hd0,msdos2) (hd0,msdos1) or (hd0,gpt2).*
Step 2: Identify the Ubuntu partition
Check each partition to see which one contains your files. Type ls followed by a partition name and a forward slash:
ls (hd0,gpt1)/
If it says "error: unknown filesystem", that is a Windows partition. Try the next one (e.g., ls (hd0,gpt2)/).If it outputs a list of folders like lost+found, home, boot, etc., you found your Ubuntu partition! (Let's assume it is (hd0,gpt2) for the next steps).Step 3: Set the Boot Variables
Now, tell GRUB where to look. Type these exact commands, replacing (hd0,gpt2) with your correct partition:
1. set root=(hd0,gpt2)
2. set prefix=(hd0,gpt2)/boot/grub
Step 4: Boot the System
Load the normal GRUB module by typing:
1. insmod normal
2. normal
*Your familiar GRUB boot menu should now appear! Boot into Ubuntu normally.*
Step 5: The Permanent Fix (CRITICAL)
If you don't do this step, you will face the grub rescue prompt again upon restarting. Once logged into the Ubuntu desktop, open the Terminal (Ctrl + Alt + T) and run:
1. sudo update-grub
2. sudo grub-install /dev/sda *(Note: use sda or nvme0n1, do not include the partition number like sda1)*.
The Live USB 'Boot-Repair' Method
Solution:
If grub rescue> cannot read your filesystem, or the manual commands failed, the GRUB core image is severely corrupted. We need to use a live USB to run the automated Boot-Repair tool.
Step 1: Boot from a Live USB
1. Grab a USB drive with the Ubuntu installer on it (the one you used to install Ubuntu).
2. Plug it in, restart, and boot from the USB via your BIOS/UEFI boot menu.
3. Choose "Try Ubuntu" (Do NOT click Install).
Step 2: Install and Run Boot-Repair
Once you reach the temporary Ubuntu desktop, open a Terminal (Ctrl + Alt + T) and run these exact commands one by one to install the repair tool:
1. sudo add-apt-repository ppa:yannubuntu/boot-repair
2. sudo apt update
3. sudo apt install -y boot-repair
4. boot-repair
Step 3: The One-Click Fix
The Boot-Repair window will open on your screen.
1. Click the "Recommended repair" button.
2. Wait a few minutes while the tool purges and reinstalls GRUB across your drives.
3. Once it finishes, it will provide a Pastebin URL (save this just in case).
4. Shut down, remove the USB drive, and turn your PC back on. Your GRUB menu should be perfectly restored!
Fixing the Standard `grub>` Prompt
Solution:
If you see grub> (without the word 'rescue'), your system found the GRUB bootloader, but GRUB failed to load the actual Linux kernel.
Step 1: Locate the Boot Partition
Type ls to see your drives. Then, test them to find your Ubuntu partition:
ls (hd0,gpt1)/
When you find the partition that contains your boot folder, you're ready for Step 2. (Assume it's (hd0,gpt1)).
Step 2: Load the Kernel Manually
Type these commands carefully, pressing Tab to auto-complete file names (which saves you from typing exact version numbers!):
1. Set the root:
set root=(hd0,gpt1)
2. Load the Linux kernel (type linux /boot/vmlinuz, press TAB to auto-complete, then add root=/dev/sda1):
linux /boot/vmlinuz-[VERSION]-generic root=/dev/sda1 *(Adjust sda1 to match your drive/partition setup)*
3. Load the initrd image (type initrd /boot/initrd, press TAB):
initrd /boot/initrd.img-[VERSION]-generic
4. Boot the system:
boot
Step 3: Permanent Fix via Terminal
Once you are successfully booted into the Ubuntu desktop, open Terminal (Ctrl + Alt + T) and permanently repair the configuration by running:
sudo update-grub
sudo grub-install /dev/sda *(replace sda with your primary drive letter)*
Fixing the 'Windows Hijack' (UEFI/BIOS Reorder)
Solution:
If your PC boots straight into Windows and entirely ignores Ubuntu, GRUB isn't broken—Windows simply set its own 'Windows Boot Manager' as the #1 priority in your motherboard's UEFI settings.
Fix A: The BIOS/UEFI Reorder
1. Restart your PC and repeatedly press your BIOS key (usually F2, F12, Del, or Esc depending on your manufacturer).
2. Navigate to the Boot or Boot Sequence tab.
3. Look for the 'UEFI Boot Order' list.
4. You will likely see Windows Boot Manager at the top. Find ubuntu in the list.
5. Use the + / - or F5 / F6 keys to move ubuntu to the very top of the list.
6. Save and Exit (usually F10). Upon reboot, your GRUB menu will return.
Fix B: The Windows CMD Override (If BIOS doesn't work)
Sometimes, aggressive Windows updates keep overriding the BIOS. We can fix this from inside Windows.
1. Boot into Windows.
2. Click the Start Menu, type cmd, right-click Command Prompt, and select Run as administrator.
3. Paste this exact command and hit Enter:
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
4. Restart your computer. Windows will now respect the GRUB bootloader on startup.