Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So I had the perfect Ubuntu 12 / Windows 7 dual boot set-up -- until I had to re-install Windows 7.

After the deed, GRUB2 was of course wiped out, thus my Ubuntu installation is rendered inaccessible.

I have tried these steps:

mount /dev/sda5 /mnt   #This is where my Ubuntu installation resides.
mount /dev/sda1 /mnt/boot #Indicated by the `*` under `Boot` when doing `fdisk -l`
mount --bind /mnt/proc /proc
mount --bind /mnt/sys  /sys
mount --bind /mnt/dev  /dev
sudo chroot mnt
sudo grub-install /dev/sda
sudo update-grub
#Then unmounted everything...

Unfortunately, only my Windows 7 has been detected and the Ubuntu entries never appeared in the prompt. Only my Windows 7 installation (/dev/sda1) is available in the GRUB2 menu.

How can I rectify this?

share|improve this question

2 Answers 2

Boot-Repair is a great graphical and automatic utility to restore grub.

Try to use the 2nd option cuz is more quick.

share|improve this answer
    
I've been meaning to use this but opted not to. I have quite a specific set-up and I'm not quite sure which options to specify as to not ruin the Windows boot loader. –  Shasteriskt Oct 17 '12 at 23:39
    
But you must "ruin" the Windows boot-loader. You have to replace it with Grub. You attempted to (in your original question) but failed. So try with this automatic tool. –  NikTh Oct 18 '12 at 5:57

Short Answer: You don't need to mount sda1 unless it contains your Linux boot folder. An easy way to check is to look at /etc/fstab after you chroot (or /mnt/etc/fstab before).

See if that makes any difference.

Long answer: If sda1 is your Windows partition, mounting it to /mnt/boot will essentially hide your Linux boot files and so grub won't find them.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.