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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-17-2005, 05:32 AM
|
#1
|
LQ Newbie
Registered: Oct 2005
Distribution: Ubuntu 5.04
Posts: 6
Rep:
|
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
|
|
|
10-17-2005, 05:50 AM
|
#2
|
Senior Member
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020
Rep:
|
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
|
|
|
10-17-2005, 11:34 AM
|
#3
|
Senior Member
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158
Rep:
|
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
|
|
|
10-17-2005, 02:07 PM
|
#4
|
LQ Newbie
Registered: Oct 2005
Distribution: Ubuntu 5.04
Posts: 6
Original Poster
Rep:
|
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
|
|
|
10-17-2005, 02:49 PM
|
#5
|
LQ Newbie
Registered: Oct 2005
Distribution: Ubuntu 5.04
Posts: 6
Original Poster
Rep:
|
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?
|
|
|
10-17-2005, 03:16 PM
|
#6
|
Senior Member
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158
Rep:
|
can you post output of
Tux,
|
|
|
10-17-2005, 04:04 PM
|
#7
|
LQ Newbie
Registered: Oct 2005
Distribution: Ubuntu 5.04
Posts: 6
Original Poster
Rep:
|
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
|
|
|
10-17-2005, 04:26 PM
|
#8
|
Senior Member
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158
Rep:
|
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,
|
|
|
10-18-2005, 02:24 PM
|
#9
|
LQ Newbie
Registered: Oct 2005
Distribution: Ubuntu 5.04
Posts: 6
Original Poster
Rep:
|
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?
|
|
|
10-18-2005, 04:30 PM
|
#10
|
Senior Member
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158
Rep:
|
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
enter your password you use to log into ubuntu;
Code:
grub-install /dev/hda
This will install the grub to MBR.
|
|
|
10-19-2005, 01:02 PM
|
#11
|
LQ Newbie
Registered: Oct 2005
Distribution: Ubuntu 5.04
Posts: 6
Original Poster
Rep:
|
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?
|
|
|
10-19-2005, 09:10 PM
|
#12
|
Senior Member
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 10:37 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|