Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Nov 2001 20:10:07 +0100
From:      Gerhard Sittig <Gerhard.Sittig@gmx.net>
To:        freebsd-mobile@FreeBSD.ORG
Subject:   Re: Two FreeBSDs on same disk, booting secondary slice?
Message-ID:  <20011111201007.F39804@shell.gsinet.sittig.org>
In-Reply-To: <3BEE8243.1115.97AA66@localhost>; from torfinn.ingolfsen@oslo.online.no on Sun, Nov 11, 2001 at 01:50:59PM %2B0100
References:  <3BEE8243.1115.97AA66@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 11, 2001 at 13:50 +0100, Torfinn Ingolfsen wrote:
> 
> For various reasons, I wish to have 2 FreeBSD installations on
> this disk. FreeBSD 4.3 is installed on slice 3 (ad0s3), and 
> FreeBSD 4.4 is installed on slice 4 (ad0s4). (This will have 
> FreeBSD-current on it later, for testing purposes).

Last time I tried this, sysinstall wouldn't have helped me there.
But with a little manual intervention it is possible.  Let's see:

It takes three slices (at least I would do and did it this way)
- one, say 128MB, for the -STABLE root fs
- another 128MB one for the -CURRENT root fs
- and a bigger one with all the rest, like
  - swap space
  - -STABLE's and -CURRENT's /usr, /var, /tmp partitions (single
    per boot option)
  - maybe shared, maybe singe /home partition, could hold a common
    source tree, CVS repo, or whatever

Putting / in separate and early created slices is what I got used
to for circumventing BIOS limitations (you surely know the infamous
1024 cylinder problem).  I don't care too much if today's machines
could cope with root fs'es located anywhere -- as long as I can
spare the separate slices I will happily do so and know things
will work. :)  Feel free to evaluate for yourself if different
layouts work. :>

You install the first system as usual with its root fs in /dev/ad0s1
and the other partitions in /dev/ad0s3.  After the system runs, you
have to act here:  boot from any recovery means (life CD, rescue
disk, whatever -- could even be Linux.  Either mark the root fs slice
as non-FreeBSD or mark the root partition something different from "a"
(neither "b" nor "c", of course).  This way it will be hidden from
the second system you are about to install.

Then install the second system and put its root fs into /dev/ad0s2
and the other partitions into /dev/ad0s3.  You may share swap and
/home here.  I would never share /usr nor /var.  And I wouldn't
think too long about sharing /tmp.  Today's disks are rather big,
even in notebooks.

When things work, you can rename the first system's root partition
back to ad0s1a.  Boot loaders don't have a problem with the situation,
they just boot the system whose(id?) root partition you jumped into.
The only "problem" IIUC is sysinstall not letting you select (even
create?  don't remember too well since my setup works now) ad0s2a as
root if there is already some ad0s1a partition.

> The problem is, when FreeBSD boots, it automatically takes the 
> first FreeBSD slice and boots from that.

No, neither did I experience this just like David never did. :)  You
might be tricked into thinking this when sysinstall's disk editor
prevents you from creating two root partitions.

> How do I make the boot process automatically boot from the slice 
> I've choosen in the boot menu?

booteasy (FreeBSD's default boot loader) works fine.  It's just
that one has to remember which two of the three FreeBSD slices
are the boot options' root fses. :)  But apart from this visual
annoyance I've not had enough pressure to look out for different
boot loaders.  I guess I boot my machines too rarely. :]

> For info, I'm using LILO as the boot loader, and I specify the correct
> partition ("slice") there, slice 3 is hda3 and slice 4 is hda4. But,
> when the FreeBSD boot loader starts, it still boots the first 
> FreeBSD slice. For various reasons, I do not wish to use booteasy, 
> if I can avoid it.

I can understand your reasons (self chosen labels, additional
parameters - for those kernels to understand them - plus boot
menus with cursor navigation and maybe even graphics screens if
you feel like it).

But I don't quite get how much of installation already happened on
your machine.  Do you already have two FreeBSD systems on it?  How
did you get there?  And if it's only one, how can you state that
the loader always starts the first one? :)  You see, I'm somewhat
puzzled ...

Do your normal installation (with the hiding mentioned above
between the two runs) and instruct the installer to *not* touch
the MBR.  I take it LILO lives there or the standard (DOS?) MBR
lives there and the Linux partition with LILO in it is the active
"partition".  As soon as LILO has gotten control, you should be
free to choose any of the discussed options:  load one of several
Linux kernels, maybe load DOS or floppy / CD images, or jump to
FreeBSD's -STABLE or -CURRENT root fs (hda3 and hda4 in your
example, which reminds me:  you have to "renumber" my examples
above, but you should get the idea).


BTW:  Many thanks to David Wolfskill whom I was discussing this
very topic with via PM back in April.  I suggest you visit his
website for another description and many more BSD hints.


virtually yours   82D1 9B9C 01DC 4FB4 D7B4  61BE 3F49 4F77 72DE DA76
Gerhard Sittig   true | mail -s "get gpg key" Gerhard.Sittig@gmx.net
-- 
     If you don't understand or are scared by any of the above
             ask your parents or an adult to help you.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011111201007.F39804>