LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   grub, two hard drives and two distros (https://www.linuxquestions.org/questions/linux-newbie-8/grub-two-hard-drives-and-two-distros-497704/)

pressman57 11-01-2006 07:26 PM

grub, two hard drives and two distros
 
Hi there.

I bought a brand new hard drive and set it up as slave, put an 80 gig partition on hdb1 and Kubuntu on hdb2. An older version of Kubuntu (breezy) lives on hda1:

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 4677 37567971 83 Linux
/dev/hda2 4678 4865 1510110 5 Extended
/dev/hda5 4678 4865 1510078+ 82 Linux swap / Solaris

Disk /dev/hdb: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 10199 81923436 83 Linux
/dev/hdb2 * 10200 19835 77401170 83 Linux
/dev/hdb3 19836 20023 1510110 5 Extended
/dev/hdb5 19836 20023 1510078+ 82 Linux swap / Solaris

When I installed Kubuntu Edgy, it looked for "other operating systems" and edited grub accordingly (hd0). I recently removed Edgy and put the partition into freespace, but when I tried to reboot the machine wouldn't recognize the grub file on hda1 (/boot/grub/menu.lst looked the same) and refused to boot. The bios only list "Hard Drive".

How can I boot directly into hda1?

pixellany 11-01-2006 10:36 PM

If I read this correctly, you deleted the partition which grub treats as "home base". GRUB has the path to its files "hard-coded" into stage 1, which is on the mbr.
You will need to boot up from an install disk, or live CD*, and setup grub. If you have good files on /dev/sda1/boot, then do this:
Code:

grub  (puts you in the grub shell)
root (hd0,0)
setup (hd0)

If the numbering looks funny, remember that grub counts from 0.

*Having a Knoppix CD on hand will help you in this and many other situations.

pressman57 11-03-2006 08:53 PM

I booted from the Kubuntu install disk, did as you suggested but it didn't work for me, had to change back to hd1,1 to get it to boot. Would this work?

root (hd0,0)
kernel /boot/vmlinuz-2.6.12-10-386 root=/dev/hda1

Should I then:

setup (hd0) ?

Or will it scare the crap out of me again?

pixellany 11-04-2006 08:37 AM

I'm confused. You said that you deleted the newer Kubuntu (edgy) which you had installed on hdb2 (aka hd1,1) How then were you able to get it to boot to that partition??

Back to basics: What is currently on each disk?

pressman57 11-04-2006 11:21 AM

I re-installed kubuntu on hda2 to get it to boot either system.

pressman57 11-04-2006 11:22 AM

kubuntu breezy is on hda1 - edgy is on hdb2.

Thanks for your help!

pixellany 11-04-2006 11:31 AM

OK--I assume you can boot into one of the two distros...

first, decide where you want to have grub use as "home base"--ie where it will find its config file. If you are going to use hdb1 as home base, the do this:
Code:

grub  starts the grub shell
root (hd1,0)  (grub-speak for hdb1)
setup (hd0)    (boot code always goes on the first HD)
OR
setup (fd0)    (to boot from a floppy)

Then, edit the grub.conf (aka menu.lst) to boot all of your distros.

Here is the grub manual.

pressman57 11-05-2006 09:13 AM

Thanks for pointing me in the right direction. The root, setup commands in grub worked with a grub cd, but not with Knoppix, (couldn't see the disk) or in the Kubuntu Live CD (created a bad file).

Thanks, I learned alot.

pixellany 11-05-2006 09:47 AM

Quote:

Originally Posted by pressman57
Thanks for pointing me in the right direction. The root, setup commands in grub worked with a grub cd, but not with Knoppix, (couldn't see the disk) or in the Kubuntu Live CD (created a bad file).

Thanks, I learned alot.

grub setup should have worked from within either one of the installed Linux distros....
Interesting about Knoppix--I need to go try it so I'll know what I'm talking about.....;)

Anyway, glad You got it fixed...


All times are GMT -5. The time now is 08:56 PM.