LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 10-04-2006, 02:59 PM   #1
crontab
Member
 
Registered: Jun 2005
Distribution: Various
Posts: 72

Rep: Reputation: 15
question about GRUB


I had Gentoo installed on my machine for a while, but I decided today to try Slackware 11. I repartitioned and formatted the drives, then I told the installer to install LILO. (Whether or not Grub is superior to LILO isn't something I'm experienced enough to concern myself with.)

The installation finished fine and I restarted. But Grub is still there, asking me what OS to boot into. I hit Gentoo Linux--which is the only option--and it tries booting into /dev/hdb3, which used to be where Gentoo's / was located. I tell it to boot into /dev/hda1 and it works fine from there.

I'm just wondering why Grub didn't get erased during the reformat. My guess is it was installed to the MBR? And also, how I can either get rid of it, or at least fix it so it doesn't try booting into the wrong directory.
 
Old 10-04-2006, 05:28 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
I would have stuck with grub personally...

Anyhoo, you can use the grub command line to boot your slack. Hit 'c' when you are at the menu, and you will see a 'grub>' prompt. Now you want to tell it where you kernels are. This will depend on whether you have a seperate '/boot' partition ot not. Assuming you do:
Code:
grub> root (hd0,0) # hd0,0 = /dev/hda1, your '/boot' partition. Grub HDD numbers are -1
[message about type of filesystem] 
grub> kernel /bzImage root=/dev/hda4 # path to your kernel, releative to /boot. 'root=' here is your '/' partition
[message about kernel]
grub> boot
And that's it, it should be booted. The grub shell has tab completion, so if you don't remember the name of your kernal you can do:
grub> kernel /[Tab]
and it will print all files in /boot.

If you do not have a seperate /boot partition, then post back your partition table, and I'll mke adjustments to the syntax for you.

Last edited by bulliver; 10-04-2006 at 05:30 PM.
 
Old 10-04-2006, 05:39 PM   #3
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
Grub is usually installed on the MBR, yes.

grub sees hard drives in order the BIOS sees them, but it does not skip like Linux would. In other words, if you have something plugged into Primary IDE master, it will be hda in Linux; in grub, it's hd0. If you then have something else plugged into secondary master, in Linux, it's seen as hdc, but in grub, it's seen as hd1 (becasue there's nothing attached to primary slave).

The same goes for partitions, in grub, the first partition is 0, the second 1, the third 2, regardless of what Linux (or fdisk) sees them as... it could be 1, 2 5, 8 in Linux, but it will be 0,1,2,3 in grub. make sense?

Knowing that, you need to install grub on the correct drive. To do this, get to a prompt, run "grub" (probably need to be root), and do the following:

Code:
root (hd0,0)                This assumes hda is the first drive in your machine & partition 1 is the first partition)... This also assumes you want grub to boot off of this drive.
setup (hd0)                 This installs grub on the MBR of hd0 (or hda)
quit
Alternatively, you could add another option on your grub menu to boot either gentoo or slackware. To do this, just add an enrty in /boot/grub/menu.lst that looks something like this:

Code:
title           Slackware
root            (hd0,0)
kernel          /vmlinuz-2.4.27-2-686-smp root=/dev/hda3 ro
initrd          /initrd.img-2.4.27-2-686-smp
savedefault
boot
of course, make sure the paths are correct from the root of the drive that holds /boot, not the root of the linux file system (in the above example, /boot is its own partition, so there's no need to include "/boot" in the paths).


edit: DOH! bulliver beat me to it. oh well.
 
Old 10-04-2006, 09:08 PM   #4
crontab
Member
 
Registered: Jun 2005
Distribution: Various
Posts: 72

Original Poster
Rep: Reputation: 15
ah, thanks to the both of you.

I didn't have a /boot/grub because I reformatted during the slackware installation, so grub was living in my MBR and I didn't know how to configure it.
 
  


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
Two things: (Probably Simple) Grub question, and a gDesklets question Wilffo Linux - Software 3 05-20-2006 01:33 PM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 01:51 PM
a question about grub!! lom Linux - Newbie 5 10-07-2003 09:43 PM
A GRUB question... concoran Linux - General 15 04-27-2003 05:28 PM
GRUB question malbo1 Linux - General 1 02-27-2003 05:23 PM

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

All times are GMT -5. The time now is 06:33 PM.

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