/ Sign-up
Your question

Restoring dual boot

  • Dual Boot
  • Grub
  • Ubuntu
Last response: in Open Source Software
September 13, 2011 6:04:09 AM

I have a dual boot on my Asus netbook -Win 7 and Ubuntu 11.04. But then I went and fiddled with the partitions to free up some space. The system failed to boot up. I restored Grub with Rescatux but Win 7 is missing from the list. Using the repair function of the Win 7 DVD I could restore Win 7 but Grub disappeared. (On booting up the screen shows MBR at the top left corner and then goes to Win 7). Is there anyway to restore Grub with Ubuntu and Win 7, other than a reinstall?

More about : restoring dual boot

September 13, 2011 6:21:15 AM

Restore GRUB again with Rescatux.

You always go Windows 1st, Linux 2nd or Windows kills GRUB.
September 13, 2011 3:09:11 PM

Or, you could try to manually fix the issue.

1) Take note of the partition# of the Windows install. For this example, I'll use /dev/sda2
2) Add a file to /etc/grub.d/, call it something like 39_WindowsVista (these files are examined in order of ascending prefixes)
3) File contents should be
exec tail -n +3 $0
menuentry 'Windows 7' {
set root='(hd0,2)'
chainloader +1
hd0 == the first disk brought up, i.e. /dev/sda, (hd0,2) means first disk, second partition (yes, they mix 0-based and 1-based counting, gotta love it)
4) Run update-grub
5) Double-check that the entry shows up in /boot/grub/grub.cfg

Any of these steps that complain about permissions, run them as root (add sudo to the front)

Edit: I really kinda miss the old way of grub, this new stuff seems overly complicated

I'd forgotten about /etc/grub.d/30_os-prober, thanks skittle
Related resources
September 13, 2011 3:17:40 PM

ubuntu has a special script to do this automatically.

'sudo update-grub'
September 14, 2011 4:25:48 AM

I've already tried 'sudo update-grub' but that didn't solve the problem.

BTW, after restoring Win 7 I ran Rescatux and tried to reinstall grub. Restarting lead to a screen with the grub> .

Went back to Rescatux and tried to use the file checking option. Only the Linux partition is detected. Re-running file check after mounting all the Windows partitions (I can do that and access files from Rescatux or an Ubuntu live CD) gave the same result. Restoring Windows through Rescatux and restarting leads to a windows message asking repair using the install CD, which I did.

So back to square one!
September 14, 2011 6:02:20 PM

Hmm, then perhaps follow through the stuff I'd stroke-through, it might just make the magic happen.
September 15, 2011 4:23:20 AM

bmouring said:
Hmm, then perhaps follow through the stuff I'd stroke-through, it might just make the magic happen.

Okay, will try that out. Should I add the last line in that post
I'd forgotten about /etc/grub.d/30_os-prober

If so, where?
September 15, 2011 5:15:07 AM

No, you can disregard the last line (I had forgotten about the existence of that file which should have fixed your issue)
July 18, 2013 2:44:02 PM

Hi All,

Just a newbie here, but I had the following:
single boot Win XP. Then, blue-screen of death no boot up.
I installed Opensuse Linux to see if I could rescue the system.
Figured it was a master boot record problem. Tried everything but did not have a Win XP resuce CD.
I got an XP install CD from a friend, brought up the rescue screen, did the "fixmbr" command that's supposed to work, It did not.
Then, trid a bunch of grub solutions. No joy.
Finally, with Gparted (free/ semi free) boot CD, I did a disk analysis and my disk was definitely bad.
So, rescued files using Gparted by copying to other drives.
Then, since I was buy a new RAM drive, I also got Windows 7 Home.
Installed Windows 7, but lost my Linux install.
Rebooted with Opensuse install CD, then lost the WIndows boot.
Look here (Tom's) for a solution. Unfurtunately, Opensuse does not use "update-grub" (at least not with the new grub2 loader).
Found this command elsewhere: (must be super user)
grub2-mkconfig -o /boot/grub2/grub.cfg

then rebooted.
My dboot is now back!!