LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-01-2005, 02:42 AM   #1
DrRider
LQ Newbie
 
Registered: Dec 2004
Location: AUS
Distribution: Yoper
Posts: 16

Rep: Reputation: 0
Lightbulb How to get GRUB from MBR boot the kernel in CD?


Hi Guys,

The problem started at I've downloaded Ubuntu LiveCD and burn it to a CD. After I've popped it into my CD drive, it booted but stopped at GRUB stage 1.5 and halted.

I use a laptop having 1 HDD and 1 DVD-RW; the optical device is using IDE1 as slave (from BIOS). I have Yoper on my box and I've tried to use my existing GRUB to boot Ubuntu but I haven't found the way (after read the entire GRUB manual).

Has someone known how to get the existing GRUB (in MBR) boot the kernel in the CD?

The way I've tried (but not seccess):
1. Try to Ubuntu section from menu.lst from Ubuntu CD and paste to my grub.conf using (cd) as a device. The GRUB told me that Error 23: Error parsing number. So...

2. Try to edit the /boot/grub/device.map by adding

Code:
(hd2)  /dev/hdc
to the file (my /dev/cdrom is pointing to /dev/hdc). After that, I tried to invoke GRUB shell using grub --device-map=/boot/grub/device.map and Yes! I can mount CD drive to be grub root. But when tried to reboot, it haven't seen my (hd2) or CD and booting error again.

GRRRRR!!! How to get GRUB seeing my CD drive and the kernel image on the CD????

Pleaseeee, anybody, please enlighten me from the dark.

Thank you in advance.
 
Old 03-01-2005, 03:41 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
You can't. grub only knows about disk (hd?) and floppy (fd?) as boot devices.

Well, as in everything, there's always someone who said "fsck it - I'll do it".
Have a look at this
 
Old 03-01-2005, 04:09 AM   #3
DrRider
LQ Newbie
 
Registered: Dec 2004
Location: AUS
Distribution: Yoper
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks. I'll try this.

Hmm, actually it looks like those 2 programs will try to read boot image on CD/DVD drive not the kernel. Will I reproduce the same error as when I booted my box from CD?

Thanks anyway.
 
Old 03-01-2005, 05:11 AM   #4
Lazarus
Member
 
Registered: Dec 2001
Location: Kent in UK
Distribution: Fedora 2
Posts: 170

Rep: Reputation: 30
Here is how I make grub bootable cd's

#!/bin/sh
# makes a pseudo 2.88 bootable floppy image for resq diskc etc
#
if [ -z $1 ]; then
echo " "
echo "type:-"
echo "make_grub_boot_image vmlinuz.x.y.z"
echo "Where vmlinuz.x.y.z is the kernel to use"
echo " "
echo "Output image is boot288.img"
exit
fi
dd if=/dev/zero of=boot288.img bs=512 count=11520
# count was 5760
#
# associate the loop device with the image file
#
/sbin/losetup -d /dev/loop0
/sbin/losetup /dev/loop0 boot288.img
#
# set up filesystem
#
/sbin/mke2fs /dev/loop0
#
# mount it
#
mount /dev/loop0 /mnt
#
# set up boot files
#
#
#copy grub files and menu
#
cd /mnt
mkdir boot
cd boot
# copy kernel
cp /boot/$1 /mnt/boot
mkdir grub
cp /boot/grub/* /mnt/boot/grub
cp /home/source/shell/grub.menu.floppy /mnt/boot/grub/grub.conf
cd $h
#
# create the device map file
#
echo "(fd0) /dev/loop0">/tmp/dev.map
cd /home/source/shell
umount /mnt
#
# install grub
#
/sbin/grub --device-map=/tmp/dev.map --no-curses --verbose<<END
root (fd0)
setup (fd0)
END
/sbin/losetup -d /dev/loop0

This makes a 2.88MB floppy image. Modify my script to suit yourself. Burn your cd using this boot image. I use 2.88Mb to suit bigger kernels!.

Here is my grub.conf for good measure

#
# This is copied to grub.conf when makeing boot floppies
#
# written 2nd May 2002
#
title hda1 (linux)
root (fd0)
kernel /boot/vmlinuz ro root=/dev/hda1
title hda2 (linux)
root (fd0)
kernel /boot/vmlinuz ro root=/dev/hda2
title cdrom
root (fd0)
kernel /boot/vmlinuz ro root=/dev/hdc init=/sbin/recover
title windows or dos partition 1
rootnoverify (hd0,0)
chainloader +1
title windows or dos partition 2
rootnoverify (hd0,1)
chainloader +1
title floppy ... hit enter after invalid system disk
# note floppy is set to fd1 because on cd boot
# fd0 is used by the boot image
rootnoverify (fd1)
chainloader +1


I hope this gets you started OK.
 
Old 03-01-2005, 06:43 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Cute.

Gotta try that one day.
 
Old 03-01-2005, 10:19 PM   #6
DrRider
LQ Newbie
 
Registered: Dec 2004
Location: AUS
Distribution: Yoper
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Lazarus
Here is how I make grub bootable cd's
....
....
....
I hope this gets you started OK.
Thanks, that's pretty cool! I'll try that some days.

I'm not sure that it'll work on my box. The problem is grub on Ubuntu 4.10 LiveCD booted on my machine but halted at stage 1.5 with error 21 (means no disk found). However, the grub on that CD can boot successfully on other boxes!

So.... my solution is to extract the Ubuntu 4.10 iso file and wash the grub out, replacing with isolinux suite. After that, I've reassembled them and make the iso image using mkisofs and burnt to CD. OK! now I can boot into Ubuntu liveCD.

I've checked the Ubuntu website as well. It states that the grub's error 21 can be found on some certain machines and no solution for this bug.

Thanks for your help anyway.

PS. It should be some ways that make grub (on HDD MBR) boot the CD directly. If this feature is implemented, it would be great!!!!

Last edited by DrRider; 03-01-2005 at 10:26 PM.
 
  


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
Installed GRUB on MBR or First Sector of boot zillah Fedora 6 06-16-2005 11:46 AM
Install GRUB in MBR or /boot? kmlinux12 Linux - Enterprise 7 09-25-2004 01:47 AM
OOPS! overwrote MBR, GRUB wont boot :( slacker9876 Linux - Newbie 4 04-16-2004 05:04 PM
reinstall grub/lilo on MBR without cdrom boot lay_Z Linux - Newbie 5 03-12-2004 05:45 AM
Help with Grub in MBR and /boot partition! zLinuxz Linux - General 11 11-17-2003 11:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:04 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