LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Chainload an OS (https://www.linuxquestions.org/questions/linux-software-2/chainload-an-os-518005/)

Ashrack 01-10-2007 09:09 AM

Chainload an OS
 
This is how I chainload GENTOO in my MENU.LST:
Code:

title                GENTOO
 root                (hd0,7)
 chainloader        +1

GENTOO is installed on 'hda8':
Code:

/dev/hda8 on /mnt/gentoo type reiserfs (rw,noatime,notail)
But all of a sudden it stopped working and I get an error on bootup.

pusrob 01-10-2007 10:23 AM

Dear Ashrack!

This is how menu.lst (it is in /boot/grub/) look like in Mepis
Code:

title Mepis
 root (hd0,7)
 kernel /boot/vmlinuz-2.6.xyz root=/dev/hda8 nomce quiet vga=791
 boot

Of course the xyz means your full kernel version (I have 2.6.15-27-686). Your kernel version can differ from mine, so search for it (the vmlinuz-2.6. file in /boot). Of course the "nomce quiet vga=791" might not work for you, becouse you have another distro. In SuSE for example the menu.lst looks like this:

Code:

title openSuSE
 root (hd0,7)
 kernel /boot/vmlinuz-2.6.xyz vga=0x31a resume=/dev/hda7 splash=silent showopts
 initrd /boot/initrd

The point is: you cannot use the chainloader +1 command with linux, and the menu.lst isn't alwasy the same in distros.
So: I don't know how exaclty menu.lst look like in gentoo, so try googling it, or ask a gentoo using forum member.

Ashrack 01-10-2007 11:39 AM

Well actually I am booting from an UBUNTU GRUB which should then chainload to GENTOO GRUB. And that is why I put the CHAINLOADER +1 command. Which used to work but now it doesnt.

I copy of the whole menu.lst

Code:



# 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'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default                0

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

## 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 options 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 specific 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_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=07a3dbbc-a412-4e1e-b572-6723431c8d97 ro
# kopt_2_6=root=/dev/hda6 ro

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

## 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

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

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

## 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

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title                Ubuntu, kernel 2.6.19.1-vanilla
root                (hd0,0)
kernel                /vmlinuz-2.6.19.1-vanilla root=/dev/hda6 ro splash
quiet
savedefault
boot

title                Ubuntu, kernel 2.6.19.1-vanilla (recovery mode)
root                (hd0,0)
kernel                /vmlinuz-2.6.19.1-vanilla root=/dev/hda6 ro single vga=0x317
boot

title                Ubuntu, kernel 2.6.17.13-ubuntu1-blue
root                (hd0,0)
kernel                /vmlinuz-2.6.17.13-ubuntu1-blue root=/dev/hda6 ro splash
quiet
savedefault
boot

title                Ubuntu, kernel 2.6.17.13-ubuntu1-blue (recovery mode)
root                (hd0,0)
kernel                /vmlinuz-2.6.17.13-ubuntu1-blue root=/dev/hda6 ro single vga=0x317
boot

title                Ubuntu, kernel 2.6.17-10-generic
root                (hd0,0)
kernel                /vmlinuz-2.6.17-10-generic root=/dev/hda6 ro splash
initrd                /initrd.img-2.6.17-10-generic
quiet
savedefault
boot

title                Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root                (hd0,0)
kernel                /vmlinuz-2.6.17-10-generic root=/dev/hda6 ro single vga=0x317
initrd                /initrd.img-2.6.17-10-generic
boot

title                Ubuntu, memtest86+
root                (hd0,0)
kernel                /memtest86+.bin
quiet
boot

### END DEBIAN AUTOMAGIC KERNELS LIST
 title                ###OTHER OPERATING SYSTEMS###
 root                (hd0,0)

 title                GENTOO
 root                (hd0,7)
 chainloader        +1

 title                Windows XP SP2
 root                (hd0,2)
 makeactive
 chainloader        +1


IBall 01-10-2007 07:24 PM

There is absolutely no reason why you can't chainload Linux distros. I have multiple distros installed, and that is exactly how I set it up. It is, I believe, the most flexible and scalable option. In fact, one of the members here (Saikee) uses GRUB to boot 145 Linux distros, using the chainloading method. See Here. I do not know where people get this idea that you can't chainload Linux.

Now, back to your problem:
1) Can you still boot into Ubuntu like normal? If so, then the problem is with Gentoo's GRUB installation.

2) If you can't get into Gentoo's GRUB, then press "c" at Ubuntu's GRUB screen. Then enter the following commands to directly boot Gentoo (tab completion will work, so use it to fill in the correct names)
Code:

root (hd0,7)
kernel /boot/vmlinuz<press tab to get the full name> root=/dev/hda6 ro
initrd /boot/initrd.img<press tab to get the full name>
boot

Hopefully, Gentoo should boot up. If it doesn't then trial and error should help :). Then reinstall Gentoo's GRUB to /dev/hda6 like before, and hopefully it should all work correctly. Note that the commands that you entered above are the same that appear in the menu.lst. If you can get into Ubuntu, then mount the Gentoo root partition, and have a look at its menu.lst to make sure that I am right.

I hope this helps
--Ian

Ashrack 01-12-2007 06:19 AM

IBALL
Thank U! U got me the idea what was wrong. I had to recreate the GRUB in GENTOO install. Now it chainloading works again.
For others interested this is how I recreated it:
Code:

grub
grub> root (hd0,7)    (Specify where your /boot partition resides)
grub> setup (hd0,7)    (Install GRUB)
grub> quit            (Exit the GRUB shell)


scribble 01-20-2007 01:50 AM

Im hoping someone might have encountered my troubles before.

Ok i have setup my partitions on a new HDD, hda1 = where grub will go, hda2 = swap, hda3-7 = logical partitions to install other OS's. When i load grub in a terminal from an xubuntu live cd, and type root (hd0,0) i get Error 21: Selected disk does not exist. Have tried geometry (hd0) and get the same thing, it's like grub cant see my HDD.

I have 2 identical drives, set to cable select on an UltraATA IDE ribbon. I can mount the drives and edit there partion tables in xubuntu live cd but grub doesnt want to know.

Can anyone give me some pointers??





Thanks for your time!
Joel

IBall 01-20-2007 08:01 PM

Just a stab in the dark - perhaps try setting the jumpers on the drive to master and slave instead of cable-select. This shouldn't work, but you never know...

Have you copied the GRUB files across to /dev/hda1 ?

I have some info on this Here.

--Ian

scribble 01-22-2007 01:47 AM

Sorry for the late reply, work sometimes gets the better of me.

I read on my hard drives to put them onto cable select so ultraATA is enabled, is this the truth? That's why i was a bit hesitant to put them on master/slave.

Also i do have the grub files copied across to the partition (hda1).

I have tried to do it the "lazy" way as described here: http://forums.pcper.com/showthread.php?t=401513

But that also doesn't work and gives me error's. Funnily enough when i installed zen linux and vector linux, on the install of vector lilo scanned and added zen to it's list. So lilo is looking better in my books at the moment :eek:

Is there a similar thing to try for GRUB?




Thanks for your time!

IBall 01-22-2007 02:47 AM

GRUB should work fine. What errors are you getting?

--ian

scribble 01-23-2007 07:14 AM

Sorry cant recall off hand. But think it was an error: 21. Something about the partition.

I have moved on to try xubuntu and scraped the multiple boot idea for now. Many thanks for your help anyway!





Thanks for your time,
Joel


All times are GMT -5. The time now is 07:51 AM.