LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Two distros, two hard disks - boot scheme (https://www.linuxquestions.org/questions/linux-hardware-18/two-distros-two-hard-disks-boot-scheme-167121/)

rabidundead 04-06-2004 10:53 PM

Two distros, two hard disks - boot scheme
 
Well, I've been thru the man pages and howtos, googled, and searched this site... i am at a loss :(

My setup:

1 hard disk is HDA - this is going to have Gentoo installed onto it

1 hard disk is HDD - this has Mandrake 10.1 on it, along with my data archives

1 cd-rw is HDC and is ide-scsi

My situation:

I am preparing to install Gentoo onto the (larger) HDA drive and I have moved the Mandrake system to the HDD drive. I have updated the fstab in MDK to account for the move. I assume this will allow MDK to bring itself up if I can manage to boot the MDK kernel.

Here is the clincher:

I am hoping to install a bootloader to the MBR of HDA and somehow boot the MDK system on HDD in such a manner that I can fdisk HDA to prepare for the Gentoo installation. This means I cannot have files stored on HDA that are depended upon by the bootloader. I plan to leave the MBR untouched until after the Gentoo install is complete.

Is it possible to install, say, LILO to the MBR of HDA and have it hand off to another copy of LILO installed on HDD somewhere? I am not familiar enough with bootloader ins-and-outs to grasp (yet) what configuration options or whatnot I would need to set to make this happen.

BTW, the original copy of the MDK system is still on HDA until this gets figured out

Thanks for any help!!!!

leonscape 04-06-2004 11:03 PM

One version of the bootloader is enough (you only have one MBR), just set lilo.conf, to match the options you want, infact Gentoo might detect the Mandrake install and add it itself.

Note down the current options in the Mandrake lilo.conf, changing the disks from hda to hdd. Then install Gentoo, and add the lilo.conf info for Mandrake into the Gentoo lilo.conf

You can test the new moved system first, by doing these changes to the current lilo.conf (copy rather then replace, so you have both options to boot ), and trying to boot the copied mandrake.

remember to run /sbin/lilo when you change lilo.conf.

rabidundead 04-06-2004 11:34 PM

I am not quite clear what variable you wanted me to change.

My partitions are: (i just did a 'df')
Code:

Filesystem            Size  Used Avail Use% Mounted on

/dev/hda6            6.8G  143M  6.6G  3% /
/dev/hda1              51M  2.7M  48M  6% /boot
/dev/hda7            4.3G  150M  4.1G  4% /home
/dev/hda8            7.7G  2.1G  5.6G  28% /usr

/dev/hdd1            4.7G  3.9G  882M  82% /mnt/mdk
/dev/hdd8              46M  2.6M  44M  6% /mnt/mdk/boot
/dev/hdd5            2.0G  153M  1.8G  8% /mnt/mdk/home
/dev/hdd6            4.4G  2.1G  2.3G  48% /mnt/mdk/usr
/dev/hdd7            1.4G  94M  1.3G  7% /mnt/mdk/var


This is my current /etc/lilo.conf on /dev/hda6:
Code:

boot=/dev/hda
map=/boot/map
vga=normal
default="Moo"
keytable=/boot/us.klt
prompt
nowarn
timeout=100
message=/boot/message
menu-scheme=wb:bw:wb:bw
disk=/dev/hdd bios=0x80
image=/boot/vmlinuz
        label="Moo"
        root=/dev/hda6
        initrd=/boot/initrd.img
        append="hdc=ide-scsi devfs=mount"
        read-only
image=/boot/vmlinuz
        label="Rescue"
        root=/dev/hda6
        initrd=/boot/initrd.img
        append="failsafe devfs=mount"
        read-only

:scratch: Am i to understand that i am to create a new 'image=' entry and that would take care of it?

I am not clear as to which variables are used by /sbin/lilo to build the bootloader and which ones are needed by the bootloader at boot time.

An example being 'map=', what variables have to exist after you run /sbin/lilo?

For the life of me, i've tried to understand the docs. :study:
But I have obviously missed some critical concept that prevents me from 'getting it'. :(

A bit more insight would be appreciated!!

leonscape 04-06-2004 11:50 PM

I presume from this you run Moo for Mandrake?

So you would copy

Code:

image=/boot/vmlinuz
        label="Moo"
        root=/dev/hdd1
        initrd=/mnt/mdk/boot/initrd.img
        append="hdc=ide-scsi devfs=mount"
        read-only

Into the new lilo.conf. ( notice the change of hda ), I dont think hdd needs to be set as disk.

The other options either refer to how lilo displays, or where it should install.

rabidundead 04-07-2004 12:06 AM

Quote:

Originally posted by leonscape

Code:

image=/boot/vmlinuz
        ...
        ...
        initrd=/mnt/mdk/boot/initrd.img
        ...


About the above filesystem paths...

Are the files these paths refer to built into the bootloader somehow when it is installed on the MBR?

Or do these files have to exist every time you boot the machine?

This is the part that prevents me from proceeding!

if I wipe out everything on HDA using fdisk and format the partitions -- won't that break those paths.. since e.g. there will no longer be a /boot or /mnt/... on HDA?

:confused:

leonscape 04-07-2004 12:18 AM

Ahh, these are labels, they are set in the filesystem with the command e2label.

to set the new disks boot partition label too boot2 you'd type

e2label /dev/hdd8 /boot2

Don't clash labels, keep the all diffrent.

so

initrd=/boot2/initrd.img

would work for the Mandrake on hdd.

rabidundead 04-07-2004 01:11 AM

:eek: i got a kernel panic using the entry you proposed.. couldn't find vfs.

Hmm..

Would it not stand to reason that 'image=/boot/vmlinuz' points to a kernel image on HDA? Such a scenario would not seem feasible, since i am formatting HDA. Am I mistaken in this thinking?

Further, how would the bootloader or kernel see '/mnt/mdk/...' prior to accessing /etc/fstab and doing a 'mount -a', at which point the proper device linked to the mount point?

I don't see how this approach could work when using filesystem paths instead of device names.. especially given a situation whereby i would have *nothing* on HDA at all except the MBR containing the bootloader.

I thought there was a way to boot lilo (or maybe it was grub) from the MBR and have it 'trigger' or 'chainload' another copy of a bootloader on another disk to continue the boot process...

:study:
I read examples of how to do this with non-linux bootloaders on other disks by using a chainloader or something. But the examples seem to explicitly exclude using this method to boot another linux disk. In fact, i tried to install another lilo on HDD through a chroot'd environment and point to it from an entry in the MBR lilo - to no avail.

Am I making sense anymore? ;)

leonscape 04-07-2004 11:46 AM

Linux systems expect to be booted from a bootloader, so they do not need to be chainloaded.

Did you set the labels? and did you alter the lilo.conf to match?

rabidundead 04-07-2004 02:05 PM

Actually, all my filesystems are JFS, so i don't think the ext2fs tools will work for setting the labels. This also seems to point out that this method is dependant upon a filesystem existing on the first hard disk.. am I to assume that the bootloader is dependant upon a filesystem existing on HDA (beyond just the MBR itself)?

I may not have been very clear. I will need to be able to boot to the second hard disk in the complete absence of filesystems on the first disk. This is why i believed a solution to be on order of this scheme:

BIOS ==> LILO/MBR ==> LILO/HDD ==> KERNEL ==> ROOT

I had come across a brief reference to this sort of successive loading of LILO. The example, however, booted another copy of LILO within a different partition of the same disk. I cannot seem to get it to boot LILO accross disk bounds though.

The method used the 'other=/dev/hda1' to point to a boot sector of a particular partition (which contained a second LILO).

It would seem bootloading is also a pastime similar to banging one's head against a wall ;)

leonscape 04-07-2004 02:28 PM

the LILO bootloader, does not require anything else to work. It doesn't acces anything but the kernel its about to boot.

so BIOS ==> LILO/MBR ==>KERNEL on HDD

Will work fine.

rabidundead 04-07-2004 03:12 PM

well, i did this:

Code:

boot=/dev/hda
map=/boot/map
vga=normal
default="Moo"
keytable=/boot/us.klt
prompt
nowarn
timeout=100
message=/boot/message
menu-scheme=wb:bw:wb:bw
disk=/dev/hdd bios=0x80
image=/boot/vmlinuz
        label="Moo"
        root=/dev/hda6
        initrd=/boot/initrd.img
        append="hdc=ide-scsi devfs=mount"
        read-only
image=/boot/vmlinuz
        label="Rescue"
        root=/dev/hda6
        initrd=/boot/initrd.img
        append="failsafe devfs=mount"
        read-only
image=/mnt/mdk/boot/vmlinuz
        label="Mandrake"
        root=/dev/hdd1
        initrd=/mnt/mdk/boot/initrd.img
        append="dc=ide-scsi devfs=mount"
        read-only

and, of course, /sbin/lilo

rebooted, selected Mandrake...

and got this:

Code:

Booting MandrakeEBDA too big . . .
:(

um, now i'm overlapping memory... either its a LILO bug or LILO is too big, since its the same kernel as the HDA boot... i wouldn't think it's the kernel... hmm.. too many images defined?

In the immortal words of Scooby Doo... "Yelp!"

leonscape 04-07-2004 04:30 PM

You still haven't set the labels. for a jfs file system use

Code:

jfs_tune -L /boot2 /dev/hdd8
( check the docs for your version of jfs_tune ). If you don't have jfs_tune download the jfs utils from your distro. Then

Code:

image=/boot2/vmlinuz
        label="Mandrake"
        root=/dev/hdd1
        initrd=/boot2/initrd.img
        append="dc=ide-scsi devfs=mount"
        read-only

Will get things working.

rabidundead 04-07-2004 05:28 PM

ok, trying it now

rabidundead 04-07-2004 05:51 PM

ssdd :(

did the label thing and made the change to lilo.conf and ran lilo... same error EBDA too big

i tried some other things and the only other error i've managed is bios 0x07 at one point... i am looking onto the bios setup at the moment..

rabidundead 04-07-2004 06:20 PM

um, looks like the bios doesn't see HDD.

PRIMARY MASTER: [size value]
PRIMARY SLAVE : [none]

SECONDARY MASTER: [CDROM]
SECONDARY SLAVE : [none]

d'olooks like i need to hand-input the geometry of the HDD disk
.. its a Western Digital 13GB that the bios couldn't see when i (way back) was fdisk'ing the hard disks to dual boot WinME/MDK7.2 ...
I had to use EZBIOS to get the BIOS to see it then... and it didn't display geometry info after EZBIOS, but it did *work*... so i don;t think i should mess with it...

grr *throws up arms* I'm at a loss now...


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