Windows clobbers Ubuntu 8.04 install

Asked by JMW

Installed Ubuntu 8.04. I reboot. The GRUB menu shows up. Select Ubuntu. Boots ok. Everything works. Reboot. Select Windows XP. She starts up. Windows XP is ok. But now when I reboot, the GRUB menu does not show up. The machine goes into a boot circle showing me the POST splash screen. Looks like windows is overriding something.

I have to repair my MBR using the Window disk and the fixmbr program to get back to my normal Windows XP only config.

It took me 3 iterations of installing Ubuntu to figure out that it was Windows that was clobbering my config.

Any suggestions?

Windows XP SP2 on drive 0.
Ubuntu 8.04 on drive 1.
Used manual partion option on Ubuntu install: 10 gigs ext2 for root, 5 gigs ext2 for \home, 4 gigs for swap.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Old_Soldier
Solved:
Last query:
Last reply:
Revision history for this message
JMW (wmj011) said :
#1

Disk /dev/sda: 20.4 GB, 20409532416 bytes
255 heads, 63 sectors/track, 2481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Here is my fdisk listing:

Disk identifier: 0x50c0b2fb

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 2481 19928601 42 SFS

Disk /dev/sdb: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x9e194381

   Device Boot Start End Blocks Id System
/dev/sdb1 1 1245 10000431 83 Linux
/dev/sdb2 1246 2365 8996400 5 Extended
/dev/sdb5 1246 1743 4000153+ 82 Linux swap / Solaris
/dev/sdb6 1744 2365 4996183+ 83 Linux

Revision history for this message
Best Old_Soldier (charles.davis) said :
#2

Take a look at this wiki page, its very helpful and will give you some insight into how grub works.

https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

Revision history for this message
JMW (wmj011) said :
#3

Windows is clobbering something on hd0 where the grub boot stub is in the MBR or something on hd1 where my root directory is and where /boot/grub stage1 is located. /boot/grub looks ok so it must be doing something else.

My point is I am not installing windows after installing Ubuntu. As I said above after having a successful dual boot config set up, Windows clobbers is the first time I boot into it.

Nevertheless I will try re-installing grub and see if that works.

Revision history for this message
JMW (wmj011) said :
#4

I re-installed grub. The grub menu list reappears. Everything works until I boot into Windows XP. After that the menu list disappears.

So now I can restore my MBR to Windows-only using fixmbr from the Windows disk or to the dual-boot config by using grub to restore the grub facility.

It looks like Windows is writing over the MBR. I don't know why or how.

Any ideas?

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#5

Always installed xp and Ubuntu never seen some like this...
Are your sure Xp don't have viruses or some boot restore software...?
May be is your pc bios...?
...

Revision history for this message
JMW (wmj011) said :
#6

marcobra,

I am thinking the same thing. I am thinking some kind of root kit is writing to the MBR for its own malicious purpose. I will try some root kit detecters, but I think I will reinstall Windows XP anew. It is time to clean up the bit rot anyway.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#7

I suggest you to fix your GRUB boot using https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

Then install clamav and/or avg for linux and make a deep scan of your ntfs Win partition from Ubuntu.

Hope this helps

Revision history for this message
JMW (wmj011) said :
#8

Re-installed Windows XP from scratch. Same problem. I noticed a message that looked like: GRUB loading stage 1.5 when it is cycling the POST splash screen.

Why would it have trouble loading after having been in Windows XP?

Revision history for this message
Jim Hutchinson (jphutch) said :
#9

I would have to agree with Marcobra that there is something in windows that is editing the MBR either maliciously or by design (AV software for example that is "repairing" the MBR.

When you reinstalled XP did you do a clean install - i.e. completely format the hard drive - or just a "repair" install? If it was a clean install, do you also install any AV software? If so, you might try disabling it and seeing if you still notice the problem. If so, I would suggest looking for a partition that may have been created as part of a rootkit or something. I would boot Ubuntu and use the tools there to scan XP as well as look closely at the drive. Open a terminal and type

sudo fdisk -l

That last letter is a small L. See if there are any unrecognized partitions showing up.

I have never known XP to make any random changes to the MBR. It will overwrite the MBR when you install. But under normal use I don't think it ever would. It would have to be either a program you have or something malicious. It could also be problems with the drive and something is causing XP to want to fix something. I don't know if it would do that automatically or not.

Revision history for this message
JMW (wmj011) said :
#10

I did a clean install of XP; completely formated the drive; no AV software.

BTW, I just installed Fedora 9 and I have the same problem. I am beginning to think it is my BIOS or something else.

I agree that XP is not known to mess with the MBR after it has installed itself.

On this machine I did have Fedora (4?) Zod in a dual boot config for years without any problems. Don't know why I am having so much trouble this time around.

Revision history for this message
JMW (wmj011) said :
#11

Correction. The problem I mentioned above with Fedora 9 was just an install problem.

I edited grub.conf and straightened everything out.

My status now is I have a dual boot config with XP and Fedora 9 working. I can boot into XP and then am able to shut down and boot into Fedora without any problem.

I am going to try, tomorrow, to install Ubuntu 8.04. I want to have XP, as well as Fedora and Ubuntu on the same rig. I created separate swap and home partions to try this out.

Revision history for this message
JMW (wmj011) said :
#12

I think I may have been wrong in some of my comments above.

Now I don't think Windows is clobbering my MBR. I don't think I had a MBR virus. Since I have Fedora working I am wondering if it may be the Ubuntu version GRUB or how Ubuntu installed this or that.

More work tomorrow.

Thanks for all the help and suggestions.

Revision history for this message
Jim Hutchinson (jphutch) said :
#13

Since grub is installed to the MBR (although the files it accesses are on the Ubuntu partition in /boot/grub) I don't see how either OS can make changes to it without some intent. Next time you have this issue, try and note exactly what error you get and what events/changes preceded it. The simple act of booting Ubuntu then XP then Ubuntu should not have any impact on the MBR or GRUB. Was Ubuntu installed with Wubi?

Revision history for this message
JMW (wmj011) said :
#14

I found a work-around. Installed Ubuntu 8.04 then installed Fedora 9. I used the Fedora 9 config as the grub root.

All three seem to work now apart from some further account setup and configuration fine tuning.

Don't know why I had the problem of losing my Ubuntu grub setup after booting into Windows, but I did. It is repeatable. Happened more than a few times.

Probably will never know. I would have to compile grub myself; duplicate the problem and find out exactly what the code is doing. Don't have the time right now.

Status = found a work around = problem solved.

Again thanks for your help and suggestions.

Revision history for this message
JMW (wmj011) said :
#15

Thanks Old_Soldier, that solved my question.