How to Fix GRUB and Boot Into Linux Manually
Sometimes your system fails to boot and drops you into a GRUB rescue or minimal shell. It can look scary at first, but don’t worry. You can manually boot into Linux and then fix GRUB properly.
This guide will walk you through the process step by step.
Step 1: Find Your Partitions
First, list available partitions using:
lsThis will return something like:
(hd0) (hd0,msdos1) (hd0,msdos2)Now you need to find which one contains your Linux installation.
Try checking each partition like this: <pre><code> ls (hd0,msdos1)/ </code></pre>
If you see folders like boot, etc, home, then that is your Linux partition.
Step 2: Set the Correct GRUB Root
Once you find your Linux partition, set it up like this:
hdx = hd0 or hd1
y = msdos0 or msdos1 (your linux partition you found above)
set prefix=(hdx,y)/boot/grub
insmod (hdx,y)/boot/grub/linux.mod
insmod part_msdos
insmod ext2
insmod gzio
set root=(hdx,y)This basically tells GRUB where your Linux system and boot files are located.
Step 3: Find Kernel and Initrd Files
Now check inside the /boot folder:
ls (hdx,y)/bootYou will see files like:
vmlinuz-xxx
initrd.img-xxxNote down the exact names because you’ll need them next.
Step 4: Boot Into Linux Manually
Now run the following commands:
linux /boot/vmlinuz-3.0.0-1-686-pae root=/dev/sdXX ro
initrd /boot/initrd.img-3.0.0-1-686-pae
bootReplace:
vmlinuz-...with your actual kernel versioninitrd.img-...with your actual initrd version/dev/sdXXwith your Linux partition (for example/dev/sda1)
If everything is correct, your system should now boot into Linux.
Step 5: Fix GRUB Permanently
Once you are inside Linux, fix GRUB so you don’t have to repeat this again:
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfgFinal Notes
- This method works when GRUB is broken but your Linux system is still intact
- The hardest part is identifying the correct partition
- Take your time when typing commands, small mistakes can cause errors
