Restore Grub 2 after reinstalling Windows XP/Vista/Wi

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
User avatar
poision
Level 3
Level 3
Posts: 143
Joined: Mon Jun 18, 2007 10:59 am
Location: India

Restore Grub 2 after reinstalling Windows XP/Vista/Wi

Post by poision »

hello,


i have reinstalled windows 7 on my dell inspiron laptop. i have linux mint 9 on same laptop.
now i need to restore my linux partion. how to restore grub2 so that i can get boot loader options again?
User avatar
markcynt
Level 6
Level 6
Posts: 1115
Joined: Sun May 17, 2009 10:53 am
Location: Lakeland Florida

Re: Restore Grub 2 after reinstalling Windows XP/Vista/Wi

Post by markcynt »

1) Boot to the LiveCD Desktop (Ubuntu 9.10 or later).

2) Open a terminal by selecting Applications, Accessories, Terminal from the menu bar.


3) Determine the partition with the Ubuntu installation. The fdisk option "-l" is a lowercase "L".

Code: Select all

 sudo fdisk -l
If the user isn't sure of the partition, look for one of the appropriate size or formatting.

Running sudo blkid may provide more information to help locate the proper partition, especially if the partitions are labeled. The device/drive is designated by sdX, with X being the device designation. sda is the first device, sdb is the second, etc. For most users the MBR will be installed to sda, the first drive on their system. The partition is designated by the Y. The first partition is 1, the second is 2. Note the devices and partitions are counted differently.

4) Mount the partition containing the Ubuntu installation.

Code: Select all

sudo mount /dev/sdXY /mnt
Example: sudo mount /dev/sda1 Note: If the user has a separate /boot partition, this must be mounted to /mnt/boot

5) Run the grub-install command as described below. This will reinstall the GRUB 2 files on the mounted partition to the proper location and to the MBR of the designated device.

Code: Select all

sudo grub-install --root-directory=/mnt/ /dev/sdX
Example: sudo grub-install --root-directory=/mnt/ /dev/sda

6) Reboot


7) Refresh the GRUB 2 menu with

Code: Select all

sudo update-grub

Any questions feel free to ask.
Image
P5N-E SLI, Core2Duo E6850 3GHZ X 2
2 GB DDR2 800MHZ
EVGA 8800GTS 320MB
2x320GB Hitachi
Arctic Cooling Freezer 7 Pro
phannyit
Level 1
Level 1
Posts: 1
Joined: Sat Aug 13, 2011 6:20 am

Re: Restore Grub 2 after reinstalling Windows XP/Vista/Wi

Post by phannyit »

Guide, I did all step already except step 7.
I don't understand what you mean "7.)Refresh the Grub menu with" and your code.What does it mean.
Can you write to make me more understand?
i did 6 step and after reboot as you see only black screen and grub command belove

grub>

I can't log into any window so how can i do step 7?
So i can not log in to Ubuntu or my XP anymore.
Post Reply

Return to “Installation & Boot”