Tuesday, July 17, 2012

Restore Grub2 after re-installation of Windows

Whenever we go for a dual booting in a system grub(Linux) overlaps the boot loader(Windows) & mbr has been rewritten so system doesn't fit to its base. So Grub is to be updated. There are other processes but we must prefer with a Livecd to enroll our banefits & it's also so simple. First boot from the livecd then Open the Terminal & run


sudo -i
mount /dev/sda7 /mnt
mount /dev/sda6 /mnt/boot  #skip this one if not have a separate /boot partition
grub-install --root-directory=/mnt/ /dev/sda

If you miss “grub.cfg” file,use following to recreate:
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt update-grub
umount /mnt/sys
umount /mnt/dev
umount /mnt/proc
exit
sudo update-grub

No comments:

Post a Comment