LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-02-2004, 10:00 AM   #1
DavidTempler
Member
 
Registered: Apr 2003
Location: United Kingdom
Distribution: Ubuntu 6.06
Posts: 172

Rep: Reputation: 30
Setting up lilo to boot two different drives


I have a box with two drives ... I want to put a distro on each one ...

Is it possible to boot each one from lilo ..??

assuming boot=/devhda1

& my other drive is hdb1 how do I get hdb1 to boot

Dave. T.
 
Old 09-02-2004, 10:20 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Yes, you can put a distro on each one:
Install both disk drives. Make sure you know which is which!
Install your first distro to hda
Then:
Boot from the CD of the distro you wish to add.
Make sure it installs to hdb ( or you will overwrite your current distro )
It should configure lilo, or grub, so you can choose which distro to boot at boot time. It really is that easy.

HTH

HTH
 
Old 09-02-2004, 11:25 AM   #3
DavidTempler
Member
 
Registered: Apr 2003
Location: United Kingdom
Distribution: Ubuntu 6.06
Posts: 172

Original Poster
Rep: Reputation: 30
Thank you very much

Dave T.
 
Old 09-02-2004, 03:04 PM   #4
mpyusko
Member
 
Registered: Oct 2003
Location: Rochester, NY, USA
Distribution: Salckware ver 10.1 - 14.1, Debian too.
Posts: 432
Blog Entries: 1

Rep: Reputation: 41
is it possible to use the same Swap for both distros?
 
Old 09-02-2004, 05:35 PM   #5
vectordrake
Senior Member
 
Registered: Nov 2003
Location: NB,Canada
Distribution: Something alpha or beta, binary or source...
Posts: 2,280
Blog Entries: 4

Rep: Reputation: 47
Yes, I always share the swap. You're only using it with one at a time, right? If your distro doesn't configure the second automatically, come back.
 
Old 09-02-2004, 06:33 PM   #6
wartstew
Member
 
Registered: Apr 2002
Location: Albuquerque, NM USA
Distribution: Slackware, Ubuntu, Debian, Maemo
Posts: 464

Rep: Reputation: 30
Re: Setting up lilo to boot two different drives

Quote:
Originally posted by DavidTempler
I have a box with two drives ... I want to put a distro on each one ...

Is it possible to boot each one from lilo ..??
If some fancy lilo or grub config utility doesn't step you through the process, basically (in lilo 'cause I don't really know grub yet) just add another entry in your /etc/lilo.conf file for another Linux, and tell it where the kernel is (probably on /dev/hdbx somewhere) and where the root file system for it is. Finally of course re-run "lilo" to actually make the changes. To boot non linux OS's from 2nd drives, the procedure is a little different - you have to do a couple of "map [drviveX] to [driveY] lines to swap the BIOS designations of the drives. You can get specifics from examples that are probably in your current /etc/lilo.conf or the tons of documentation available (and probably installed in your /usr/doc/lilo-* directory)

I usually then swap the drives and install a lilo on /dev/hdb as a backup, which is useful if you mess up the lilo on your first drive, or your first drive fails.

lilo or grub is really worth learning (along with the convoluted booting process of a modern PC) because they are very powerful for doing these kinds of things, but they will also prevent your computer from booting if you get something wrong. With good knowledge of your boot loader, you will be able to repair problems quickly. Otherwise you have beg for help on a forum like this one and sweat it out waiting for a response.
 
Old 09-02-2004, 07:48 PM   #7
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
My 2 cents -- Yes, sharing a single swap partition between multiple distros is just fine. In fact I would recommend it - giving each distro its own swap is just a waste of space. That being said I would recommend against trying to share any other partitions. Different distros sometimes put things in different places, and although it may be possible to share certain other partitions, I don't think it would really be worth the effort. If you really needed to retrieve a file from the other distro, you could just temporarily mount the partition in question. -- J.W.
 
Old 09-03-2004, 02:18 AM   #8
DavidTempler
Member
 
Registered: Apr 2003
Location: United Kingdom
Distribution: Ubuntu 6.06
Posts: 172

Original Poster
Rep: Reputation: 30
Thanks guys...

The problem I have is that my second drive is set up for reiser4 ....

setting boot=/dev/hda1 means that its looking at that drive only

so I have to use image=/mnt/hdb1/<path to boot>/vmlinuz

I tried to use other = (which looks for lilo on second drive) which booted lilo on second drive but as system on hdb1 was not set up correctly (my fault) then it will not boot.

Swap well thats another thing its set up on both drives ... some will argue that I only need one set up others might say you do not need it at all .. for me its there thats all that matters :-)

No you learn about Linux if its all done for you .. so if something does go wrong you have no idea where to start.

Linux being so flexible allows you many options to get back up & running (without having to reinstall) unless you have done something really wrong (as root)

For my part I have learned a little more about lilo...

Dave
 
Old 09-03-2004, 03:11 AM   #9
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 608

Rep: Reputation: 50
Actually I think it is a good idea to have a small swap partition on each drive you have. But use them all in every distro. You will gain performance.
 
Old 09-03-2004, 03:39 PM   #10
vectordrake
Senior Member
 
Registered: Nov 2003
Location: NB,Canada
Distribution: Something alpha or beta, binary or source...
Posts: 2,280
Blog Entries: 4

Rep: Reputation: 47
I'm not sure what to recommend with the reiser4. I just installed it myself, which is why I have only one distro installed. I installed a minimal Gentoo with a new kernel with reiser4 support and got the reiser4progs, made the former mandy partition reiser4 and copied the Gentoo install to it to see if it would boot and run. All was well, so I created reiser4 on the former Gentoo partition and copied it back (more disk space, you see). That's all I know about reiser4 so far. It works. It boots. But, I'm using a 2.6.8.1 kernel...I'm no help.
 
Old 09-03-2004, 06:17 PM   #11
wartstew
Member
 
Registered: Apr 2002
Location: Albuquerque, NM USA
Distribution: Slackware, Ubuntu, Debian, Maemo
Posts: 464

Rep: Reputation: 30
Quote:
Originally posted by DavidTempler
Thanks guys...

The problem I have is that my second drive is set up for reiser4 ....

Dave
Assuming you are saying that the Linux on /dev/hda doesn't support reiser4, here are some possible solutions:

1) Go get (patch & compile probably) and install a kernel and module set that will work with the distro you have on /dev/hda but also knows about reiser4 on your linux that is on /dev/hda. Boot up on it and do the lilo thing.

2) Boot up on the kernel from /dev/hdb but the root from /dev/hda if you can. In otherwords, run /dev/hda's Linux using /dev/hdb's kernel. You might have to copy the /lib/modules/ directory from /dev/hdb to /dev/hda if you need any modules loaded to access either file system or devices to be able to run lilo.

3) Don't use the lilo from the Linux at /dev/hda, boot into /dev/hdb and use the one from there instead. You still need to have it install the boot loader on /dev/hda. I've never tried anything like this, but it is likely it can be made to work.

4) Boot into the /dev/hdb linux, but then mount the root of the /hda linux and "chroot" into it. Then run lilo. The trick here will be to put an additional mount point to your /dev/hdb linux in your chrooted /dev/hda so that the lilo.conf file direct lilo to the kernel on /dev/hdb from looking at /dev/hda. I think I've done this before, but can't remember the trick.

5) Just copy the kernel and initrd (if you have one) from /dev/hdb to some safe place on /dev/hda, edit lilo.conf so it can find it in it's new location, and re-run lilo. This is probably the simplest solution.

6) Physically swap the two hard drives and do everything from the linux on /dev/hdb which is now /dev/hda. This is also a pretty simple solution.

Even if not stated, all of the above solution will require some changes to your lilo.conf file so it knows where to find everything and where to install everything. Also, some of these solutions will require both hard drives to be in the computer in their present configuration in order to boot anything at all. This is a little scary to me, but people who do the striping RAID-0 arrays are use to this kind of thing.


Last edited by wartstew; 09-03-2004 at 06:23 PM.
 
Old 09-03-2004, 06:31 PM   #12
wartstew
Member
 
Registered: Apr 2002
Location: Albuquerque, NM USA
Distribution: Slackware, Ubuntu, Debian, Maemo
Posts: 464

Rep: Reputation: 30
Oh yea, an it is a good idea to put the swap file on the fastest or the least busy hard drive and controller. Of course these days people put so much RAM in their machines that the swap file seldom gets used anyway, so you might not notice much difference.
 
Old 09-03-2004, 06:53 PM   #13
wartstew
Member
 
Registered: Apr 2002
Location: Albuquerque, NM USA
Distribution: Slackware, Ubuntu, Debian, Maemo
Posts: 464

Rep: Reputation: 30
Quote:
Originally posted by DavidTempler
I tried to use other = (which looks for lilo on second drive) which booted lilo on second drive but as system on hdb1 was not set up correctly (my fault) then it will not boot.
Oh yea, I've made this work before too, but there might have been a trick to it.

A mistake that is often made is that the view of the hard drives at boot time (thus the BIOS view) may not be the same as the view of things from the fully booted Linux that you are about to run "lilo" on. Lilo versions 22.5 and later help fight these problems.

I think you are going to know a lot more about lilo before all this is over! Don't give up, I've found that there is always a way to get lilo do what you want. It is just that is is very confusing trying to figure out what went wrong when the computer won't boot.
 
Old 09-04-2004, 02:54 AM   #14
DavidTempler
Member
 
Registered: Apr 2003
Location: United Kingdom
Distribution: Ubuntu 6.06
Posts: 172

Original Poster
Rep: Reputation: 30
Hi all,

Thanks for the replies...

Setting up lilo is just a part of it ... you also have to also configure fstab to see the parition you want to boot.

my lilo.conf (which is working) looks like this:

Code:
image=/mnt/hdb2/boot/vmlinuz26mm
        label=resier4
        root=/dev/hdb2
        read-only
        append="devfs=nomount"
the last line as the one that gave me most problem but thats another story

as has been said there are many ways to boot system but this although not the best is one that works for me ...

I have learned so much about lilo over the last couple of days ... always the way when you have to figure things out..

Dave T.

ps try using mm4 kernel for using reiser4
 
Old 09-04-2004, 07:44 PM   #15
wartstew
Member
 
Registered: Apr 2002
Location: Albuquerque, NM USA
Distribution: Slackware, Ubuntu, Debian, Maemo
Posts: 464

Rep: Reputation: 30
Quote:
Originally posted by DavidTempler
Setting up lilo is just a part of it ... you also have to also configure fstab to see the parition you want to boot.
Yes, this is true if the position of the hard drives have changed since you ran the installer for the linux you installed on /dev/hdb. When it is wrong, entering a "root=/dev/hdb1" or whatever as a boot parameter at the lilo prompt should get the thing to boot, at least in single user mode (the filesystem checks in the init scripts for the higher modes usually get all freaked out when fstab is all wrong)

Quote:

my lilo.conf (which is working) looks like this:

Code:
image=/mnt/hdb2/boot/vmlinuz26mm
        label=resier4
        root=/dev/hdb2
        read-only
        append="devfs=nomount"
So I'm confused, how did you get your Linux that was on /dev/hda (which I assume didn't know about resier4) find /mnt/hdb2/boot/vmlinuz26mm. How were you able to mount it?

Quote:
ps try using mm4 kernel for using reiser4
Yes from all the benchmarks, it does seem that resier4 is an all-around killer file system. I'll eventually give it a try.
 
  


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
Lilo 2 drives - want to change boot drive Neze Slackware 11 12-06-2004 03:53 PM
How to config lilo to boot from two Hard Drives. mlsbraves Linux - General 4 09-13-2004 08:16 PM
Lilo boot on two hard drives tr0j4n Linux - Newbie 5 02-16-2004 01:37 AM
how-to for using lilo to boot two separate drives jackopa Linux - General 4 04-19-2002 02:39 PM
how to use lilo to boot between IDE & SCSI drives jackopa Linux - General 0 04-15-2002 12:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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