LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-17-2005, 05:32 AM   #1
the_affman
LQ Newbie
 
Registered: Oct 2005
Distribution: Ubuntu 5.04
Posts: 6

Rep: Reputation: 0
Grub bootloader in Ubuntu 5.04


Hi I installed ubuntu on a partition of hd0 and deleted windows off the partition it was on. then installed a second hard drive out of an old computer with windows xp already installed on it. When i change the bios setttings to boot off hd1 windows boots fine. Change it back to boot off hd0 and grub comes up, and shows the windows installation yet tries to boot the one i deleted. how can i get grub to boot windows properly?

PS Ubuntu is Great!! and linux in general is better than great!!


Here is my /boot/grub/menu.lst file:

# 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/hda3 ro

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

## 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,2)
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda3 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,2)
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda3 ro single
initrd /boot/initrd.img-2.6.10-5-386
savedefault
boot

title Ubuntu, kernel memtest86+
root (hd0,2)
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/hdb1
title Windows XP
root (hd1,0)
savedefault
makeactive
chainloader +1

Thank you for your kind time and help

theaffman
 
Old 10-17-2005, 05:50 AM   #2
b0nd
Senior Member
 
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020

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

Thank you for your kind time and help

theaffman
Hello,
remove this entry from grub.conf/menu.lst
its b'coz of this entry that its showing the older windows entry which you have already deleted.

regards
 
Old 10-17-2005, 11:34 AM   #3
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158

Rep: Reputation: 62
instead of removing...you could just comment it out with a # at the beginning of each line. This would give a reference point in case you need to refer to grub windows entry later on.

-Tux
 
Old 10-17-2005, 02:07 PM   #4
the_affman
LQ Newbie
 
Registered: Oct 2005
Distribution: Ubuntu 5.04
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by ruudra
Hello,
remove this entry from grub.conf/menu.lst
its b'coz of this entry that its showing the older windows entry which you have already deleted.

regards
there was another windows listed there that i removed, i thought that the one there would boot off hd1, because the windows that i deleted is on hd0. If i'm wrong in this i'm sorry please advise. I will try your idea though

thankyou
 
Old 10-17-2005, 02:49 PM   #5
the_affman
LQ Newbie
 
Registered: Oct 2005
Distribution: Ubuntu 5.04
Posts: 6

Original Poster
Rep: Reputation: 0
ok tried that, now grub isn't displaying windows at all, so how do i get it to boot onto the hd that i pulled out of my old computer?
 
Old 10-17-2005, 03:16 PM   #6
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158

Rep: Reputation: 62
can you post output of

Code:
fdisk -l
Tux,
 
Old 10-17-2005, 04:04 PM   #7
the_affman
LQ Newbie
 
Registered: Oct 2005
Distribution: Ubuntu 5.04
Posts: 6

Original Poster
Rep: Reputation: 0
Disk /dev/hda: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 3824 30716248+ 7 HPFS/NTFS
/dev/hda2 3825 4488 5333580 f W95 Ext'd (LBA)
/dev/hda3 * 4489 4998 4096575 83 Linux
/dev/hda5 3825 4461 5116671 b W95 FAT32
/dev/hda6 4462 4488 216846 82 Linux swap / Solaris

Disk /dev/hdb: 13.6 GB, 13613064192 bytes
255 heads, 63 sectors/track, 1655 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 1654 13285723+ 7 HPFS/NTFS
 
Old 10-17-2005, 04:26 PM   #8
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158

Rep: Reputation: 62
So which one do you want to boot now...this one
Quote:
/dev/hda1 1 3824 30716248+ 7 HPFS/NTFS
Or this one.

Quote:
/dev/hdb1 * 1 1654 13285723+ 7 HPFS/NTFS

the grub entry for the first one would be
Quote:
###grub entry for windows on /dev/hda1
title Windows on hda1
rootnoverify (hd0,0)
chainloader +1
Quote:
the grub entry for the second one would be
###grub entry for windows on /dev/hdb1
title Windows on hdb1
rootnoverify (hd1,0)
chainloader +1
Grub recognizes disks and partitions a little different way than fdisk does.

hda (fdisk) --> hd0 (grub)
hdb (fdisk) --> hd1 (grub)
partition 1(fdisk) --> partition 0 (grub)
partition 2(fdisk) --> partition 1 (grub)

so in your case,

hda1 translates to (hd0,0)
hdb1 translates to (hd1,0)

Hope this explains things...feel free to ask if you are still having problems. Once you are able to boot windows you can modify the title as you want.
Tux,
 
Old 10-18-2005, 02:24 PM   #9
the_affman
LQ Newbie
 
Registered: Oct 2005
Distribution: Ubuntu 5.04
Posts: 6

Original Poster
Rep: Reputation: 0
thank you but that didn't work, grub starts the windows loader but the windows loader displays two versions of windows niether of which load due to missing a file, i can't remember which one. I know that windows will load because when i change the bios settings it does. would formating the boot sector of hda(hd0) to clean up any remnants of that windows help? if so How? and how would i get my system to boot again?
 
Old 10-18-2005, 04:30 PM   #10
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158

Rep: Reputation: 62
You cannot format just the bootsector of the hard drive. I am not sure why grub is not recognizing your setup. My guess is that it does not have updated disk geometry i.e. it does not know about your changed disk geometry after you changed switched the hard drives. I would suggest you log into ubuntu and reinstall the grub on MBR.

1. First back up the menu.lst file at a convenient location (away from /boot/grub), then

Code:
sudo grub
enter your password you use to log into ubuntu;

Code:
grub-install /dev/hda
This will install the grub to MBR.
 
Old 10-19-2005, 01:02 PM   #11
the_affman
LQ Newbie
 
Registered: Oct 2005
Distribution: Ubuntu 5.04
Posts: 6

Original Poster
Rep: Reputation: 0
thank you, but i tried the commands you said and it came up with an error message.
it didn't recognize the comands.

Whats MBR?
 
Old 10-19-2005, 09:10 PM   #12
b0nd
Senior Member
 
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020

Rep: Reputation: 45
Hello,
MBR stands for Master Boot Record.
its the first 64 sectors of your hard drive i.e from 0-->63 sectors.
Its the sector where your boot strap loader ( grub/lilo or of windows ) reside.
actually whole grub doesn't resides in it. It keeps a pointer to the entry of grub, which you generally have in /etc/grub.conf.
Where as whole lilo resides in MBR.
So when you make any changes to lilo, u have to re-run it. But its not the case with grub.

regards

Edit: If i'm wrong plz. correct me.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I disable the grub bootloader and enable the lilo bootloader? abefroman Linux - General 1 08-06-2005 08:53 AM
Grub bootloader BiLLie- Linux - Newbie 19 07-16-2005 03:09 PM
GRUB bootloader spits out "GRUB hard disk error" Crampedson Linux - Software 2 01-26-2005 06:34 PM
GRUB bootloader dbaker Linux - Software 1 06-11-2003 05:52 PM
GRUB Bootloader mehmood_kajee Linux - Newbie 2 06-29-2001 03:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration