4 Steps: How to restore Grub2

What is grub ? GNU GRUB is a Multiboot boot loader. It was derived from GRUB, the GRand Unified Bootloader, which was originally designed and implemented by Erich Stefan Boleyn. Detailed information can be found at http://www.gnu.org/software/grub/.

Maybe you’ve reinstalling the operating system like Microsoft Windows XP/Vista/7 or other operating systems that result in lost grub2 on your system.

how to restore that ?

1. Use a linux live cd to access the Linux partition.
2. Check your linux partition that implements grub2 used fdisk utility.

bash-4.1# fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x288d7074

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63   101450474    50725206    7  HPFS/NTFS/exFAT
/dev/sda2   *   101451776   164360191    31454208   83  Linux
/dev/sda3       164360192   172746751     4193280   82  Linux swap
/dev/sda4       172746813   625142447   226197817+   f  W95 Ext'd (LBA)
/dev/sda5       172746815   467988946   147621066    7  HPFS/NTFS/exFAT
/dev/sda6       467989010   528746776    30378883+  83  Linux
/dev/sda7       528746840   625142447    48197804   83  Linux

2. Mount Linux partition to /mnt, In this example Linux partition on “/dev/sda2”

bash-4.1# mount /dev/sda2 /mnt

3. Installing grub2

bash-4.1# grub-install –root-directory=/mnt/ /dev/sda

4. Reboot

Good Luck !

Advertisements
This entry was posted in Linux. Bookmark the permalink.