LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-21-2004, 07:08 PM   #1
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Rep: Reputation: 30
how to configure GRUB to start a bootloader on a cd?


hi,

i know this isn't debian-specific, but you guys are a lot more knowledgeable than most of the peeps on this forum. and i use debian, so i think this question is appropriate here.

how can i configure GRUB to start a bootable CD? my cd-rom drive is enumerated as /dev/hda, so i tried editing /boot/grub/devices.map and adding a line that says

(hd3) /dev/hda

and then adding a grub entry in /boot/grub/menu.lst that does

chainloader (hd3)+1

but i got an error message that says "device does not exist."

my ultimate goal is to map the mbr of my primary hard drive so that the windows installer won't overwrite it during install. of course, i need to know how to get grub to actually load a cd-rom bootloader first.

thanks for any thoughts on how to do this.
 
Old 07-21-2004, 07:44 PM   #2
macondo
Senior Member
 
Registered: Jul 2003
Posts: 1,016

Rep: Reputation: 52
"how can i configure GRUB to start a bootable CD?"

hehe, i use GRUB to boot from 2 different hard drives, but i don't much about it.
You want GRUB to boot a live-CD? Why? the live-cd won't affect your windows. it boots from the cd, the cd IS the defacto hard drive in this case. Maybe i'm misunderstanding.

"my cd-rom drive is enumerated as /dev/hda,"

Strange. /dev/hda should be your hard drive. Depending on your hardware, cd-rom should be /dev/hdc or d.

"so i tried editing /boot/grub/devices.map and adding a line that says

(hd3) /dev/hda"

hehe! GRUB is different from LILO, is always one number behind.

Example: (hd 0,0) means: first drive, first partition

"and then adding a grub entry in /boot/grub/menu.lst that does

chainloader (hd3)+1"

it doesn't work that way

"but i got an error message that says "device does not exist."

hehe!

"my ultimate goal is to map the mbr of my primary hard drive so that the windows installer won't overwrite it during install. of course, i need to know how to get grub to actually load a cd-rom bootloader first."

Am i to understand you got Debian installed already and NOW you are going to install windows? <shaking head>

IIRC, that's a no-no, windows first, then linux. Otherwise windows will take over the mbr, windows is selfish. It just won't work or maybe there is a way that i don't know.

You are going to do some serious googling, #debian channel on the IRC, the hardware forum on THIS site, come back and tell us what you found out.
 
Old 07-23-2004, 06:27 PM   #3
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Original Poster
Rep: Reputation: 30
restoring the mbr is as easy as a single command

Code:
grub-install /dev/hdb2
where "/dev/hdb2" corresponds to "/boot" after the windows installer nukes it (my cd drive is "/dev/hda" because it is on the first connection on the first IDE cable so my first hd is "/dev/hdb"...this enumeration really doesn't matter in terms of what i am interested in doing). of course a Debian boot floppy is necessary to get back into the GNU/Linux system to do this.

like i said, my goal is to find a way to trick the windows installer into writting the mbr to the wrong partition (like (hd7) or (hd35) which probably won't exist).

the thing is that grub has builtin functionality to map partitions to different partitons. so when windows writes to (hd2) or (hd3), i can map those partitions elsewhere, hence stopping the mbr nuke.

my thought was that if the windows bootloader could be started from grub, debian (or any distro) could add a grub menu entry that says "start bootable cd" which would always map the mbr elsewhere just in case the user is using that function to start the windows installer.

maybe i'm just too much of an idealist. it's not that big of a deal to do the above to restore the bootloader. i know how to do it. new GNU/Linux users don't know how to do it though. i got my friend to install debian (he's used redhat and suse before), but the grub windows boot entry was messed up, so he tried to configure the grub menu list, completely messed up the config file, so he couldn't boot anything, got pissed off at that, so he tried to restore the mbr using the windows installer rescue mode, which completely fooked the mbr, got freaked out, went and bought a new hd because he was afraid he lost his precious data. now he did all of this before he consulted me about anything. anyway, being able to start a bootable cd from grub would allow the user to attempt to reinstall windows to the partition that grub expects without overwriting grub in the process. it would also just make the dual boot installation process easier for all new Linux users.

these are just my thoughts. i've done a lot of googling, and i've come across how to do this with a windows boot floppy, but not a bootable cd. foppies are going by the wayside, so a bootable cd solution is necessary.

perhaps i need to sumbit a feature request to the grub developers.

Last edited by zero79; 07-23-2004 at 06:30 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to configure GRUB to start bootloader on a CD? zero79 Linux - Software 2 07-20-2004 07:17 PM
GRUB bootloader !! maseby Red Hat 3 10-27-2003 03:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 03:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration