LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Grub help (https://www.linuxquestions.org/questions/linux-general-1/grub-help-140592/)

sicone 01-30-2004 11:08 PM

Grub help
 
I need help re-configuring grub ,it wont boot my xp hard drive.It is on a seperate hard drive with fat32 ,I can mount it when I am booted into linux but I cant boot from to it without
unhooking my *nix HD I attempted to edit the grub boot chainloader ...but I didnt know what i was doing soo...any help

Breezwell 01-31-2004 12:30 AM

Assuming your Linux is the primary master and WinXP is the primary slave, try the following:

default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

# Linux Drive
title=Linux
root (hd0,0)
kernel (hd0,0)/boot/bzImage root=/dev/hda3

# Windows
title=Windows XP
root (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader+1

Make sure that the partition location of your kernel image (bzImage) is specified correctly in in following line:

root/dev/hda3

Also make sure that the name you gave your kernel image is correct. My example shows it to be bzImage, but you can name it anything you like.

This will only work if you make the Linux drive the primary master and Windows the primary slave.

sicone 01-31-2004 12:36 AM

Do i even need to modify the Linux info it boots with no problem and when I mount windoze in Linux it is hdb1 does that make a differnce ? And can i modify grub from in Linux without having to reboot? thanks

Breezwell 01-31-2004 09:45 AM

You do not need to modify the Linux portion of GRUB if it is booting Linux properly.

hdb1 is telling you that Windows is on the first partition ( probablly only partition unless you have multiple operating systems on the drive) of the second drive ( secondary master). In your Windows section, the line that reads:

root (hd1,0)

is telling GRUB to look at driver number 2 ( primary slave), partition 1. GRUB uses its own numbering system when dealing with devices starting at 0.

The example I gave you should allow you to boot Windows as long as you follow the primary master and secondary master scheme I described in my first response.


GRUB typically installs itself in /boot/grub/grub.conf
You will need to reboot to make sure it works after editing the file. One of the really nice things about GRUB is that it will allow you to pass options to the actual grub.conf file at boot time if you have any problems. If GRUB fails on a boot attempt, reboot and when presented with your choice of booting options, press 'e' and you should be able to manually control the grub.conf file from a prompt. Make sure and record whatever changes you make to GRUB while doing this so you can permanently change the actuall grub.conf file when you have successfully booted.

sicone 01-31-2004 07:57 PM

It didnt work this is my grubconf
Code:


# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/hda2
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
        root (hd0,0)
        kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdd=ide-scsi
        initrd /initrd-2.4.20-8.img
#Mshit
title =Mshit
root (hd1,0)
map  (hd0)(hd1)
map  (hd1)(hd0)
chainloader +1


bhob 01-31-2004 09:01 PM

Re: Grub help
 
Quote:

Originally posted by sicone
I need help re-configuring grub ,it wont boot my xp hard drive.It is on a seperate hard drive with fat32 ,I can mount it when I am booted into linux but I cant boot from to it without
unhooking my *nix HD I attempted to edit the grub boot chainloader ...but I didnt know what i was doing soo...any help

Edit the following file: /boot/grub/menu.lst
and add:

title windows
root (hd1,0)
map (0x81) (0x80)
map (0x80) (0x81)
makeactive
chainloader +1

here is part of mine:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
timeout 10
color black/cyan yellow/cyan
i18n (hd0,0)/grub/messages
keytable (hd0,0)/us.klt
altconfigfile (hd0,0)/grub/menu.once
default 3

title gnu/linux
kernel (hd0,0)/vmlinuz root=/dev/hda5 devfs=mount hdd=ide-scsi vga=788


#this is the line that tells grub to boot the 2nd harddrive
# and lie to windows that
#it is the 1st drive

title windows
root (hd1,0)
map (0x81) (0x80)
map (0x80) (0x81)
makeactive
chainloader +1
~~~~~~~~~~~~~~~~~~~~~~~~~~
Make a copy of this file before you modify it (cp menu.lst menu.lst.old)
Also is a good idea to put comments into the file where you made modifications
Grub is actually very easy to use & modify. If you have any boot floppies you made you might want to update your changes to this file also.


All times are GMT -5. The time now is 09:13 PM.