Dual Boot Vista and Ubuntu on two hard drives

Asked by Cosmopoet

Hello

I tried my best to do this on my own but I have had no success. I tried EasyBCD1.7.1 and other guides and still no luck

I have installed Ubuntu 7.10 on a 20 GB hardrive sperately from the Vista 150 GB and then installed both into the machine.

Vista is the Primary and Ubuntu is the Secondary. I cannot get Ubuntu to boot. However if I remove the Vista HD by disconnecting the IDE cable Ubuntu boots fine. Vista quite dominant here. Need some advice please.

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
Jim Hutchinson
Solved:
Last query:
Last reply:
Revision history for this message
Jim Hutchinson (jphutch) said :
#1

Ubuntu uses the GRUB boot loader. It's probably installed on the 20GB drive but not seen when booting because the primary drive boots fine without it. I bet if you go into your bios and change the order of the drives it will boot fine. However, if you didn't have both drives connected when you installed Ubuntu then it didn't see the existence of windows and the GRUB loader won't be set up to offer it as a boot option. You can fix this by adding the option. It's not hard but it is slightly technical. We can walk you through it. First, try changing the order of drives in the BIOS (i.e. make the Ubuntu drive primary) and let us know what happens.

Revision history for this message
Cosmopoet (jvoldeck) said :
#2

Hello Jim,

Thanks for the very quick response. No, I did not install Ubuntu with Vista. Both OSes were installed in the same machine at different times. I have grown to like Ubuntu and got tired of switching the drives.

Do you still want me to swith BIOS or just make the GRUB changes?

Thanks
Joe

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

That's kind of up to you. Making the change in the BIOS will help confirm suspicions but not necessary. However, you will need to boot Ubuntu while the windows drive is connected to do this the "easy" way. It will also end up with ubuntu as primary but it really won't matter. It's been a while since I did this so let me dig up the steps.

Revision history for this message
Cosmopoet (jvoldeck) said :
#4

Hello Jim,

Take your time. I appreciate the help. BTW I just changed the BIOS order and Ubuntu boots fine. I am using it now to post this.
I posted the last one from Vista

Thanks again
Joe

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

Okay, this is a little how to I wrote a while back. It wasn't written to actually add a new OS to the menu so I'm not sure if it will do what you need.

http://nococomp.com/?p=8

If not, the update-grub command should do what you need (provided the windows drive is visible) but I've never used it before. To use it, open a terminal and type

sudo update-grub

For more info on GRUB and some more involved solutions to your problem check

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

Revision history for this message
Cosmopoet (jvoldeck) said :
#6

Hi

I will give it a go see what happens then post back :)

Revision history for this message
Cosmopoet (jvoldeck) said :
#7

Hello Jim,

No go :( Ubuntu doesn't see the Vista drive. At least that is what I think. I hit the "esc" key on boot and Vista wasn't in there. This is after I did a sudo update-grub hmmm... seems this is a tough one. It appears that this is a difficult thing to do anyhow as I read posts around the net.

Revision history for this message
Cosmopoet (jvoldeck) said :
#8

After further review Ubuntu sees the drive in the home folder, so the drive is there. I Just don't know how to tell Ubuntu to let me select this for boot, on Boot

Revision history for this message
Cosmopoet (jvoldeck) said :
#9

Output of the terminal

joseph@joelinux:~$ sudo update-grub
[sudo] password for joseph:
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.22-14-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

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

Open a terminal and type

sudo fdisk -l

Let's see what Ubuntu is seeing. We can add the GRUB entry manually.

Revision history for this message
Cosmopoet (jvoldeck) said :
#11

Here is the output

Disk /dev/hda: 160.0 GB, 160041885696 bytes
37 heads, 20 sectors/track, 422407 cylinders
Units = cylinders of 740 * 512 = 378880 bytes
Disk identifier: 0x13331332

   Device Boot Start End Blocks Id System
/dev/hda1 * 3 422403 156288000 7 HPFS/NTFS

Disk /dev/hdb: 20.5 GB, 20547841536 bytes
255 heads, 63 sectors/track, 2498 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe4651a0a

   Device Boot Start End Blocks Id System
/dev/hdb1 * 1 2388 19181578+ 83 Linux
/dev/hdb2 2389 2498 883575 5 Extended
/dev/hdb5 2389 2498 883543+ 82 Linux swap / Solaris
joseph@joelinux:~$

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

Well, odd that the update-grub didn't see the windows drive. I thought that's what it was supposed to do. Maybe not. Anyway, try this...

We are going to edit the GRUB menu. You can make a backup but we won't be changing much so it should be easy to undo if needed. However, to make a backup open a terminal and do

sudo cp /boot/grub/menu.lst /boot/grub/menu.bak

There is a space after the .lst part. Next do

gksudo gedit /boot/grub/menu.lst

That will open the file for editing. If you want the GRUB menu to show up so you don't have to press escape follow step 1 and 2 below or skip if you don't care.

1. Look for the line that says timeout. Change the timeout line to something a bit longer than the 2 or 3 seconds it usually has to give you time to react. 10 seconds is the default on a dual boot instal so change the timeout line to say

timeout 10

2. Comment out the hidemenu line

#hidemenu

3. Look for the line that looks like ### END DEBIAN AUTOMAGIC KERNELS LIST section and then add the following below it. It's just the default text from my old menu.lst when I still had windows but should work. I modified it for your drive name.

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Windows Vista
root (hd0,0)
savedefault
makeactive
chainloader +1

Save, close and reboot to test.

To be honest, getting all the names right with two different drives and not knowing how everything is set up can be tricky. If this doesn't work don't be surprised. My main concern is that if you changed the Ubuntu drive to be primary why is the windows drive still "a" and Ubuntu "b" (from /dev/hda1, etc). I guess we'll find out.

Revision history for this message
Cosmopoet (jvoldeck) said :
#13

Hello Jim,

I am back now thanks for the help here.
I got the Windows Vista to show up in the boot menu but it fails. As an alternative I can physically set Ubuntu as the first drive and Vista as the second and then reinstall Ubuntu. DO you think it wil matter if I put them on two different IDE channels?

e.g. Ubuntu Primary Disk 0
       Vista Secondary Disk 0

I haven't gotten to the point where I am settled in with Ubuntu yet, as I knew this might have been an issue. So I am prepared to reinstall Ubuntu again if need be. Once I know that it is correct than I can add my Ubuntu creature comforts :)

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

If you can solve it without reinstalling that will just add to your skill level. However, I have "cheated" many, MANY times so it's your call. If you reinstall, setting Ubuntu as primary and windows as secondary would probably be the easiest. It doesn't really matter to either OS (when you boot windows it will become primary) but it would mean not having to change the MBR of the windows drive.

You should be able to get this working without a reinstall though. The main problem is matching up the right device names in grub. Assuming you haven't changed this bios yet, try making a small change to the grub menu.

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hdb1
title Windows Vista
root (hd1,0)
savedefault
makeactive
chainloader +1

That doesn't actually mesh with your fdisk output above but if the one before didn't work maybe this will. Who knows what your bios is doing before the os loads :).

Revision history for this message
Cosmopoet (jvoldeck) said :
#15

Hello Jim,

In the abcense of the last post I rearranged the drives and put Ubuntu first and Vista Second and it still boots into Vista.
I completely agree about solving this to increase my skill level and I am all for that. Let me recheck my BIOS and see if I haven't confused myself by making too many changes so rapidly.

Will post back thanks!
Joe

Revision history for this message
Cosmopoet (jvoldeck) said :
#16

Hello Jim,

Ok, now I know fopr suer that my BIOS is correct.

Primary IDE Primary Device is CD Rom on 0
Primary IDE Secondary Device IDE <none>

Secondary IDE Primary Device 20 GB Maxtor with Ubuntu and booting fine
Secondary IDE Secondary Device 160 GB Seagate with Vista and booting fine

After I made those changes I did another fdisk -l and here is the result

Disk /dev/hdc: 20.5 GB, 20547841536 bytes
255 heads, 63 sectors/track, 2498 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe4651a0a

   Device Boot Start End Blocks Id System
/dev/hdc1 * 1 2388 19181578+ 83 Linux
/dev/hdc2 2389 2498 883575 5 Extended
/dev/hdc5 2389 2498 883543+ 82 Linux swap / Solaris

Disk /dev/hdd: 160.0 GB, 160041885696 bytes
37 heads, 20 sectors/track, 422407 cylinders
Units = cylinders of 740 * 512 = 378880 bytes
Disk identifier: 0x13331332

   Device Boot Start End Blocks Id System
/dev/hdd1 * 3 422403 156288000 7 HPFS/NTFS
joseph@joelinux:~$

When booting normally of course Ubuntu is the primary boot and GRUB has the Vista entry however I do not thin that this is the correct setuo now as things have changed.

THe error I get is this

Error 13 Invalid or Unsupported executable format.
This was the same error I got prior to making the drive changes.

I guess we can go from here.

Thanks
Joe

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

okay, looks like things are very different now. Try this in the grub menu

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hdd1
title Windows Vista
root (hd3,0)
savedefault
makeactive
chainloader +1

And let me know what happens. You might give update-grub a try again too.

Revision history for this message
Cosmopoet (jvoldeck) said :
#18

Hello Jim,

Made the edits and saw Vista again in the boot menu however I got >>> Error 21 selected disk does not exist. Go figure???

I also did a update-grub too and it doesn't see the windows disk

Strange ...very

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

I've noticed strange behavior like this before. For example, I had windows on hdb but had to use hda. It seems that the drive name changed when the windows drive became the boot drive. It didn't make any sense but it worked so I didn't argue. If something similar is going on for you, keep changing the vista line in grub (as indicated below) to see if there is one that works. I know there is an automatic way to make it do this but I can't remember. Did you try the steps on my how to? (http://nococomp.com/?p=8)

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1 (or hdb1 or hdc1)
title Windows Vista
root (hd3,0) (or hd1,0 or hd2,0)
savedefault
makeactive
chainloader +1

Revision history for this message
Cosmopoet (jvoldeck) said :
#20

Hello Jim

Houston.... we have solved the problem!

The correct drive was hd1,0

This never dawned o me as this was the drive. It should have becasue oin the BIOS this is what it is. HDD-1 Didn't put the 2and2 together.

You have provided excellent instructions and I am going to look over your site to help me become a better Linux Server admin.

Thanks a ton Jim now I have to figure out how to install ISPconfig on CENT OS 5

Joe

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

Glad I could help. If you would mind marking the "best" answer here as the one that "solved the problem" I'd appreciate. Thanks.

Revision history for this message
Cosmopoet (jvoldeck) said :
#22

Thanks Jim Hutchinson, that solved my question.

Revision history for this message
Naition (naithangallego) said :
#23

I had the same problem and followed the direction provided. However when I used:

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1 (or hdb1 or hdc1)
title Windows Vista
root (hd1,0)
savedefault
makeactive
chainloader +1

it seems that my pc gets hung up on " -Starting Up"

Any suggestions?

Thanks