PDA

View Full Version : [ubuntu] GRUB removed after Windows 7 boot



1emming
August 13th, 2011, 09:13 AM
Dear all,

I'm running Ubuntu 11.04 and Windows 7 on a Dell Inspiron.
On boot I get the GRUB menu listing Ubuntu (+ old versions) and Windows 7.
However, if I boot Windows 7 all is fine until I reboot.
On this next boot GRUB is gone and Windows boots.
Ubuntu is still there, I can get into using my live-cd and 'repair' GRUB. After that, on booting GRUB is back and fine (including Windows 7).
Does any one have an idea how to fix the booting/GRUB thing more constructive?

raja.genupula
August 13th, 2011, 11:31 AM
have you restored your grub ?

1emming
August 13th, 2011, 01:34 PM
have you restored your grub ?
I did, booting Ubuntu from the live cd. After that grub was back and I could boot Ubuntu.
However, if I boot Windows 7 and reboot, grub is gone.
Having to restore grub by using the live cd each time after I boot Windows 7 is less ideal.

coffeecat
August 13th, 2011, 01:41 PM
It's possible you've been hit with this issue:

http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/debian/2010-08-28-windows-applications-making-grub2-unbootable

http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:Windows_Writes_To_MB R

Although normally you'd simply get a grub error and nothing will boot after you try a restart from Windows. Long story short: a rogue Windows application (some are listed in the second link) is writing to the embedding area and overwriting or partly overwriting grub's core.img. The embedding area is the space between the partition table and the first sector of the first partition. The second link refers to it as the extended mbr.

You'll need to check what startup apps are enabled in Windows.

EDIT: by the way, when you run grub-install from the CD, do you get a warning that a particular named app is installed to a particular sector (less than 63)? If you do, this can give a clue as to what the rogue Windows app is.

YesWeCan
August 13th, 2011, 01:47 PM
Curious. Have you just got the one disk?
I would like to see what is happening with your MBR. It is as if something in Windows is rewriting the MBR each time.

It would be helpful if you can run this http://bootinfoscript.sourceforge.net/ and post the result, once for when grub is there and once after it is gone.

YesWeCan
August 13th, 2011, 02:00 PM
@coffeecat
In spite of what those links claim, I would be interested in seeing an ATA spec that says the 62 sectors after the MBR are meant to be reserved for booting purposes. My understanding is that they are not meant to be used at all. And this is consistent with how the MBR system is meant to work - the boot loaders are meant to be inside partitions. So in this respect I consider Grub no less "rogue" than those Windows programs.

YesWeCan
August 13th, 2011, 03:43 PM
@1emming
FYI it is not necessary to install Grub to the same disk as Ubuntu. So if you fail to track down the Windows conflict and you have another disk or a USB memory stick, and your bios allows booting it, you can install Grub to it. This will avoid the problem.

1emming
August 14th, 2011, 10:11 AM
Thanks for the quick replies!

From the list of applications that might cause problem I'm almost sure one or two are installed (not by choice, but by default).
I'll make a usb-stick ready for booting, so I'll try to reproduce the error later on. Then I'll recover GRUB and get back here with new results :)
I added the fdisk print out and the results file generated by the Boot Info Script.

coffeecat
August 14th, 2011, 10:22 AM
From the list of applications that might cause problem I'm almost sure one or two are installed (not by choice, but by default).

Ah, Dell! Bless them. :rolleyes: Yes, I believe it is default start up apps as set up by the manufacturer that are a common cause of this issue. See what you have as startup apps.


I'll make a usb-stick ready for booting, so I'll try to reproduce the error later on. Then I'll recover GRUB and get back here with new results :)

No - don't recover grub immediately. If you get the situation again where booting into Windows knocks out grub, run the boot script before you re-install grub. It would be interesting to see what it says about sector 1 and core.img.

Or there again, you might want simply to disable any Dell utilities that are set to start on bootup and see if this solves the problem. In my experience manufacturer's utilities are more trouble than they are worth even when they don't nuke bootloaders. :wink:

1emming
August 14th, 2011, 10:44 AM
Ah, Dell! Bless them. :rolleyes: Yes, I believe it is default start up apps as set up by the manufacturer that are a common cause of this issue. See what you have as startup apps.

Oh well, gotta love them :P I'll check what is on at start-up, but somehow I've got this feeling that it won't that easy to get rid of them ;)



No - don't recover grub immediately. If you get the situation again where booting into Windows knocks out grub, run the boot script before you re-install grub. It would be interesting to see what it says about sector 1 and core.img.

Or there again, you might want simply to disable any Dell utilities that are set to start on bootup and see if this solves the problem. In my experience manufacturer's utilities are more trouble than they are worth even when they don't nuke bootloaders. :wink:

I would like to run the script, just to get the information complete and send it to Colin Watson. After that, all the utilities from Dell will go :)
If reboot into Ubuntu after Windows using the live version on USB stick, will this be to late to get the information?

coffeecat
August 14th, 2011, 10:54 AM
I would like to run the script, just to get the information complete and send it to Colin Watson. After that, all the utilities from Dell will go :)

I'm not sure whether the boot script will provide the information that Colin Watson needs - he refers to dd-ing the whole embedding area. I must admit this was partly for my own interest to see if the very first bit of RESULTS.txt shows something interesting. This could be useful for others hit with the same issue


If reboot into Ubuntu after Windows using the live version on USB stick, will this be to late to get the information?

It would be useful to run boot script again, if:

1 - You've booted into Windows and this causes your original problem - i.e. your grub menu disappears and you can only boot into Windows.

2 - You've now booted into the live USB and you haven't yet run grub-install. That is, run the boot script before you repair grub with grub-install.

This will also be useful in that it might clear up one mystery. As I said before, this issue usually results in an unbootable system with a grub error because you still have grub code in the mbr and a damaged/overwritten core.img in the embedding area. Somehow your system is able to boot into Windows, which is odd.

1emming
August 14th, 2011, 01:11 PM
Sorry, this is kind of a frustrating report, but here it is never the less.
This is what I did;
- Rebooted and started Windows 7 and logged in as administrator.
- Waited for a while to let Windows do all its upgrades
- Removed all Dell utils. (which I shouldn't have done right away)
- Rebooted, and no problems, Grub shows up
- Tried to reproduce the error by rebooting several times into Windows and Ubuntu, but no problems

This is the point I started to think that indeed Dell utils. is the problem and got on the chat with a collegue having the same problems.
He did the same as I did and is now fine as well. The frustating part is not having the logs or any other paperwork to back this up.
Based on this, its either the Windows update (we were running behind a lot since we both didn't want to boot Windows), or the remove of the Dell stuff.
I think doing both will fix this for most people running into this problem (and making sure running the latest version of Grub).

Thanks for the support! I'm happy to have this working again.
On a side note, the smilie with the popcorn next it makes me hungry (and even more happy)

coffeecat
August 14th, 2011, 01:48 PM
I'm glad your system is now working as it should be. Yes, I'd agree that you can consider the Dell utils as the underlying cause. The problem is solved after you remove them - this could be co-incidence, but it's more likely to be cause and effect.

Good luck!