PDA

View Full Version : [ubuntu] 9.10 Karmic/Vista dual-boot works briefly, but then MBR keeps getting trashed



sfordin
November 17th, 2009, 02:35 AM
I've been dual booting Ubuntu and Vista for over a year on my Toshiba A205, starting with Ubuntu 8.10. Never a problem before with Grub or the MBR getting trashed. However, since doing a clean install of 9.10 Karmic, I cannot get dual booting to work consistently.

It'll work for a couple of power/reboot cycles, but then the MBR gets wrecked. The only thing for it after that is to use a Vista rescue CD to do a bootrec /fixmbr, then boot into Ubuntu using an install CD and run grub-install. Again, things will seem to work: Grub starts, and I can boot normally into either Vista or Ubuntu. It'll work for a couple of power cycles or reboots, but then it all goes south again: When I power on, the machine will go through its normal POST routine, a brief Grub hello string will be displayed (no menu though), and then the machine will reboot again and again, in an endless loop.

Just to clarify, I've tried reinstalling Ubuntu several times, all with the same result. That is, I am doing a clean install of 9.10, not an upgrade. I started with the GPartEd live CD to blow away my old partition. In different installation attempts, I've tried creating a new 18GB ext4 partition at / and a 7GB swap directly from within GPartEd and from within the Ubuntu installer. Makes no difference. I have a single hard drive that's partitioned as follows:

/dev/sda1 -- Toshiba factory recovery partition (physical)
/dev/sda2 -- Vista partition (physical)
/dev/sda3 -- Ubuntu ext4 partition on / (physical)
/dev/sda5 -- Linux swap (logical)

Again, I never had this issue on this machine with versions of Ubuntu prior to 9.10.

Any suggestions? Thanks in advance for any assistance.

Scott

drs305
November 17th, 2009, 02:41 AM
What is the DEFAULT= set to in /etc/default/grub? Is it possible it is booting to DEFAULT=X, the recovery partition?

Originally are you setting it up to make a choice. You might change the timeout to -1 so that it never automatically boots to a particular OS until you manually select it - at least until you see if that stops the problem.

sfordin
November 17th, 2009, 03:01 AM
I don't believe it's trying to boot into the recovery partition, but that's worth a look. Thanks for the excellent suggestion. I just looked at the grub.cfg I saved before blowing away partitions after my latest Ubuntu installation attempt. Indeed, the grub.cfg says set default="0". Hmmm.

Two weird things about this are that:
Booting into the recovery partition is not an option in the Grub menu list. Booting would work normally for a couple of power or reboot cycles before it stopped working.


Well, again, it's worth following up on this when I try installing Ubuntu again. Question though: The grub.cfg file warns not to edit the file by hand, so how do I change the default option? Lame question, I know, but I confess I don't know the answer, other than editing the file by hand.

Thanks again,

Scott

drs305
November 17th, 2009, 03:12 AM
Actually, in the previous I didn't mean DEFAULT=0, but DEFAULT=X with X being the recovery option. The first one (0) is usually your Ubuntu partition, but you can take a look. I'd still try to make sure you manually select the OS to start to see if that makes a difference.

You make most of the normal changes to /etc/default/grub.
0 is the first menuentry, 1 the second, etc. So you would change the DEFAULT= line. You can also use the DEFAULT=saved option, which would boot to the one last used (I'd stick to manual until you get this sorted out).

Here is a short guide I wrote on making the basic changes:
Grub 2 - 5 Common Tasks (http://ubuntuforums.org/showthread.php?t=1302743)

The GRUB2 link in my signature line has lots more information. The "G2 Basics" link also covers most of it, and there are links at the bottom of the first post on several other excellent guides written by forum members.

sfordin
November 17th, 2009, 03:15 AM
Thanks very much for the tip. I'll take a look at your "Common Tasks" page and let you know how it goes.

Thanks again,

Scott

sfordin
November 17th, 2009, 03:34 PM
Well, I'm sad to report that I still can't get it to work... I did a fresh install of Karmic 9.10 last night, changed the GRUB_TIMEOUT in /etc/default/grub to "-1", and then did an update-grub. I was able to boot into Ubuntu just fine, even after a couple of power cycles and reboots. After I booted into Vista, however, things went south again on the next boot: Back to the brief "Grub loading" message, followed by a reboot, followed by "Grub loading," followed by reboot. Wash, rinse, repeat.

At one level, it looks like a Vista thing, but then I have to note that this was not an issue when I was using Ubuntu 9.04, nor have I done anything particularly earth-shattering with my Vista installation. I've been on Vista SP2 for many months now.

Next step, I suppose, is to try going back to 9.04.

sfordin
November 17th, 2009, 07:57 PM
SOLVED! (More or less...) Upon further research, it appears that Grub2 is not compatible with Windows Vista. Can't say for sure about Windows 7, but since 7 and Vista use the same bootloader, I believe Grub2 is also incompatible with 7.

The solution is, when installing Ubuntu 9.10, to not install the Grub2 bootloader in the primary Vista boot partition. That is, don't override Vista's MBR. Instead, install the Grub 2 bootloader in some other partition -- I chose the root of the partition in which Ubuntu is installed -- and then let EasyBCD (http://neosmart.net/dl.php?id=1) manage the boot handling from the Windows side.

To summarize:

Install Vista/Windows 7 Install EasyBCD in Windows. Install Ubuntu in its own partition (or set of partitions, just not in the same partition as Vista). Make sure during Ubuntu installation to not put the Grub2 bootloader in the Vista partition; that is, don't overwrite Vista's MBR. Boot back into Vista, launch EasyBCD, and create a new Linux entry for Ubuntu. It is not necessary to use NeoGrub here, BTW. Have fun booting between the two OSs!


Hope this helps. Thanks again to Dave for your responses.

Scott

KevMac
November 18th, 2009, 01:48 AM
Ha Ha this dual boot with vista 32 bit and 64 bit and ubuntu 9.10 onto a raid array is a good head ache.

Spent two days sorting it out and eventually it worked and well

1 installed ubuntu onto a raid array (to do this clear the raid first and then partition it into two) just right click on partition and select size you want - make it physical -and also the root -that just means a /) Yes you can put all the files inc swap in one place - I find it works faster.

reboot and let ubuntu start up

Close down and install vista onto the spare partition and then reboot (will only be able to boot to windows)

Reboot and let it start up and then reboot and this time let it boot again from ubuntu disk and reinstall ubuntu onto the same partition as before just follow it through and it is very easy the second time you install - you will see both partitions and pick the right one!

reboot and this time you will see a menu to select which system you want to boot with ie windows or ubuntu.

Absolutely works well

Good luck all

Kevin