Fixing Grub bootloader

From Greenlivingpedia, a wiki on green living, building and energy

Jump to: navigation, search

The Grub bootloader is used by many Linux systems as the primary program for loading the operating system. Grub displays a menu with choice of resident operating system to boot into, which typically include Linux and any Windows operating systems present.


[edit] Deleting partitions causes the boot manager to fail

If you remove a partition from the your hard disk, the numbering system of the remaining partitions can be affected.

For example: if your hard disk has these partitions: sda1 (windows recovery), sda2 (windows XP), sda3 (Ubuntu), sda4 (Linux Mint)

And you delete sda3 (Ubuntu)

Then sda4 becomes sda3

The Grub bootloader will fail and present you with:

GRUB loading
error:unknown filesystem
grub rescue>

[edit] The solution

This is a simple solution for fixing this problem and restoring the GRUB bootloader.[1]

  1. . Boot for the live cd for the remaining Linux distro (e.g. Linux Mint)
  2. . Open a terminal
  3. . Type: sudo fdisk -l
    1. This will show you active disk partitions
  4. . Determine which partition the remaining Linux distro is installed on (e.g. sda2)
  5. . Mount the partition: sudo mount -t ext3 /dev/sda2 /mnt
  6. . Re-install Grub: sudo grub-install --root-directory=/mnt/ /dev/sda

[edit] External links

[edit] References

  1. GRUB error: unknown filesystem, grub rescue,
Personal tools