Wednesday 9 November 2011

Restore Grub 2 after reinstalling Windows XP/Vista/Wi

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 allotment with the Ubuntu introduction. The fdisk choice "-l" is a lowercase "L".

CODE: SELECT ALL

sudo fdisk-l

Since the user isn't beyond any doubt of the segment, search for one of the proper size or arranging.

Running sudo blkid would furnish more info to help find the genuine segment, in particular if the allotments are named. The device/drive is designated by sdX, with X being the apparatus designation. sda is the first gadget, sdb is the second, and so on. For most users the MBR can be introduced to sda, the first head on their framework. The part is designated by the Y. The main parcel is 1, the second is 2. Note the mechanisms and parcels are numberd specially.

4) Mount the allotment holding the Ubuntu instatement.

CODE: SELECT ALL

sudo mount /dev/sdXY /mnt

Sample: sudo mount /dev/sda1 Note: If the user has a divided /boot segment, this should be mounted to /mnt/boot

5) Run the grub-commission order as depicted underneath. This will reinstall the GRUB 2 documents on the mounted segment to the genuine area and to the MBR of the designated gadget.

CODE: SELECT ALL

sudo grub-commission--root-directory=/mnt/ /dev/sdX

Sample: sudo grub-fix--root-directory=/mnt/ /dev/sda

6) Reboot

7) Refresh the GRUB 2 menu with

CODE: SELECT ALL

sudo overhaul-grub

No comments: