khalid.A
June 3rd, 2010, 07:48 PM
I've installed ubutnu 10.04 (dual booting, windows 7 installed first). I just created a new partition for ubuntu and then installed it, and everything worked fine. Now, whenever I start Win7, I find that the MBR is overwritten by Win7. To fix it, I need to boot from ubuntu live cd and do the following to recover it.
sudo fdisk -l
sudo mount /dev/sda5 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /sys /mnt/sys
sudo mount --bind /proc /mnt/proc
sudo chroot /mnt
grub-install /dev/sda
This recovers GRUB but once I start Win7, Win7 wipes off the MBR again. I hate booting from ubuntu live cd to write the commands each time to recover GRUB. Any solution will be appreciated.
sudo fdisk -l
sudo mount /dev/sda5 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /sys /mnt/sys
sudo mount --bind /proc /mnt/proc
sudo chroot /mnt
grub-install /dev/sda
This recovers GRUB but once I start Win7, Win7 wipes off the MBR again. I hate booting from ubuntu live cd to write the commands each time to recover GRUB. Any solution will be appreciated.