Adding an OS to grub.

Asked by Jeff

For some reason when I installed Ubuntu, Grub did not pick up Vista on my other hard drive (i installed Ubuntu on a seperate hard drvie than vista). How can I add vista to the boot list?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu grubconf Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

  • by Jeff
Revision history for this message
Jim Hutchinson (jphutch) said :
#1

See if either of these get you going. In short, you will need to edit the
/boot/grub/menu.lst config file. It has some examples for adding windows.
Using two different drives can get confusing but these sites should give you
some good info.

http://users.bigpond.net.au/hermanzone/p15.htm

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

Hope that helps

On 6/22/07, Jeff <email address hidden> wrote:
>
> New question #8621 on Ubuntu:
> https://answers.launchpad.net/ubuntu/+question/8621
>
> For some reason when I installed Ubuntu, Grub did not pick up Vista on my
> other hard drive (i installed Ubuntu on a seperate hard drvie than vista).
> How can I add vista to the boot list?
>
> --
> You received this question notification because you are an answer
> contact for Ubuntu.
>

--
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

Revision history for this message
Jeff (jcgir22090) said :
#2

Thanks for the response. However, those sites didn't really explain how to add an OS to the grub menu, I'll keep looking around.

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

You have to scroll down a bit. Go here,

http://users.bigpond.net.au/hermanzone/p15.htm#Operating_system_Entries

and then scroll down to the part that says

"Windows Operating System Entries"

There should be enough info there to create the menu item for adding windows.

Revision history for this message
Félim Whiteley (felimwhiteley) said :
#4

Hi Jeff,

You basically need to edit the /boot/grub/menu.lst file in a text editor (there may be a graphical tool for this?).

What way have you got the drives installed, ie. Is Ubuntu your primary IDE and Vista on the Secondary IDE channel ? You first need to find out where Vista is installed so you can work out the proper text to place inside the grub config file.

If Vista is on your Secondary Master you need to fool it into thinking it's the primary HDD. If you can tell me the drive order I can attempt a config for you.

Félim

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

Here is a bit more info. Yours will probably look like this if windows is on the second hard drive (i.e. the boot drive is NOT the drive that has windows)...

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

Mine looks like this but I have windows on the same drive as ubuntu (i.e. the boot drive)...

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

Depending on your setup and where windows is installed, neither of these may work. In that case, post the output of

sudo fdisk -l

To do that, open a terminal and copy and past that text. If you type it, the last letter is a lower case L.

Revision history for this message
Bhavani Shankar (bhavi) said :
#6

Yes you are right... I have ubuntu in a separate rieserFS partion and my menu.lst_addwindowsentrygrubmenu.txt file output (full) for a sample is like this...

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default optons below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hda2 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,1)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## nonaltoption boot targets option
## This option controls options to pass to only the
## primary kernel menu item.
## You can have ONLY one nonaltoptions line
# nonaltoptions=quiet splash

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## ## End Default Options ##

title Ubuntu, kernel 2.6.10-5-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-386
savedefault
boot

title Ubuntu, kernel 2.6.10-5-386 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.10-5-386
savedefault
boot

title Ubuntu, kernel memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
savedefault
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# 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 Microsoft Windows
root (hd0,0)
savedefault
makeactive
chainloader +1

and you can cross check with this.. In /dev/sda1 i have installed WinXP Professional SP2.

and my sudo fdisk -l output is like this for an info..

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 2422 19454683+ c W95 FAT32 (LBA)
/dev/sda2 2423 8832 51488325 f W95 Ext'd (LBA)
/dev/sda3 8833 9729 7205152+ 83 Linux
/dev/sda5 2423 4844 19454683+ b W95 FAT32
/dev/sda6 4845 7266 19454683+ b W95 FAT32
/dev/sda7 7267 8789 12233466 b W95 FAT32
/dev/sda8 8790 8832 345366 82 Linux swap / Solaris

Where * is my partition loaded with Win XPP.. LBA means Logical Boot Address..

Revision history for this message
Jeff (jcgir22090) said :
#7

thanks for the answers!

Revision history for this message
Bhavani Shankar (bhavi) said :
#8

No Problems!

Revision history for this message
Jeff (jcgir22090) said :
#9

umm I'm still having trouble with this but in the strangest way. My Vista is on the primary boot drive, and Ubuntu is on the secondary. For some reason Ubuntu belives it is on the primary boot drive and Grub didn't pick windows up at all. So what I need to do is add a completley new entry for windows.

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

Grub should be placed on the primary hard drive regardless of what OS is on that drive. It needs to be what boots first so that you can choose your OS.

You may have problems booting ubuntu, however, because, at least in my experience, when it's on the second drive and then booted the bios thinks it's the first drive so drive letters like /dev/sdb1 don't work and need to be /dev/sda1 in the menu.lst. That is what ultimately worked for me. Your case may be different.

As for the windows entry, try this one if windows is on the primary drive

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

If you installed with the windows drive disconnected that would account for grub not picking it up. However, it's odd that it would miss it otherwise. Did you change the drives in the bios when installing or did you use the install tool to choose the second drive for ubuntu? If you chose the drive during install, did you have it install grub to HD0 or HD1? HD0 should be what you want.

Revision history for this message
Bhavani Shankar (bhavi) said :
#11

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

should be changed to
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Windows Vista
root (hd0,1)
savedefault
makeactive
chainloader +1
If you have changed your bios settings (HD1 in above case)..
Also Check the title field entry..

Revision history for this message
Bhavani Shankar (bhavi) said :
#12

Sorry its root (hd1,0) sorry for the typo error..

Can you help with this problem?

Provide an answer of your own, or ask Jeff for more information if necessary.

To post a message you must log in.