TechTorch

Location:HOME > Technology > content

Technology

Fixing the GRUB Rescue: No such partition Error: A Comprehensive Guide

March 28, 2025Technology2521
Fixing the GRUB Rescue: No such partition Error: A Comprehensive Guide

Fixing the 'GRUB Rescue: No such partition' Error: A Comprehensive Guide

The GRUB rescue prompt often indicates a problem with the GRUB bootloader, typically due to misconfiguration or corruption of the boot partition. This guide offers a step-by-step approach to identify and resolve the issue, ensuring a smooth boot process.

Understanding the GRUB Rescue Prompt

When your system encounters a GRUB rescue prompt, it means the GRUB bootloader is unable to locate the necessary files to start your operating system. Common reasons include misconfiguration or damage to the boot partition.

Steps to Resolve 'GRUB Rescue: No such partition' Issue

Follow the comprehensive troubleshooting steps outlined below to resolve the issue and ensure a successful boot.

Identifying Available Partitions

From the GRUB rescue prompt, you can list the available partitions using the command:

ls

This will display a list of partitions, such as hd0msdos1 or hd0msdos2.

Identifying the Correct Partition

You need to identify which partition contains your Linux installation. Inspect each partition by typing:

ls hd0msdos1/

Replace hd0msdos1 with the partitions listed from the previous step. Look for the presence of directories such as /boot or /grub.

Setting the Root and Prefix

Once you find the correct partition, set it as the root. For example, if your Linux installation is on hd0msdos1, enter:

set roothd0msdos1

set prefixhd0msdos1/grub

Loading Normal Module and Booting Your System

Try loading the normal GRUB mode:

insmod normal

normal

If successful, this will take you to the GRUB menu. Select your operating system and boot it from there.

If You Can't Access Normal GRUB

If the above steps do not resolve the issue, you may need to repair GRUB using a live USB or CD.

Booting from Live Media

To use a live USB or CD, boot into a live environment from the USB or CD.

Open Terminal in Live Environment

Open a terminal in the live environment.

Identifying Your Partitions

Use fdisk or lsblk to find your root partition:

sudo fdisk -l

Mounting the Root Partition

Replace /dev/sdXY with your root partition:

sudo mount /dev/sdXY /mnt

Mouting Additional Directories

Mount the necessary directories to make them accessible:

sudo mount --bind /dev /mnt/dev

sudo mount --bind /proc /mnt/proc

sudo mount --bind /sys /mnt/sys

Chroot into the Mounted System

Chroot into the mounted system:

sudo chroot /mnt

Reinstall GRUB

Reinstall GRUB, replacing /dev/sdX with your disk without the partition number:

grub-install /dev/sdX

update-grub

Exit Chroot and Reboot

Exit the chroot environment and reboot the system:

exit

sudo reboot

Conclusion

After following the steps outlined in this guide, your system should boot normally. If you continue to experience issues, consider checking for disk errors or file system corruption, or consult more specific documentation or forums related to your Linux distribution.