OpenBSD Multiboot Installation on UEFI

2020-06-06 Thread marto1980
Dear all,

multiboot installation of a BSD system with other operating systems
(OSs) on UEFI hardware is not officially supported by any of the
popular
BSDs. Because of the general interest in this topic, here I would like
to share my experience of running DragonFly BSD, OpenBSD, and Slackware
Linux on an UEFI ASUS laptop. The only boot manager you need is
[rEFInd](http://www.rodsbooks.com/refind). The tutorial is appended at
the
end of this post. I have also attached it as an .md file for better
readability in case some formatting is lost. I hope you will find the
tutorial useful.

Best regards,

Martin Ivanov


# Installation of OpenBSD in a multiboot on a UEFI machine 

## Preliminaries

As each OS is going to reside on its own hard drive slice,
the first step of setting your system for multiboot is slicing the hard
drive. In general, if you want to multiboot n OSs, you would need n + 1
slices. The extra slice is for the EFI system partition (ESP). Of
course, you have to make sure each partition is large enough for the OS
that is going to reside on it. As mentioned, in this tutorial I share
my
experience with installing DragonFly, OpenBSD, and Slackware Linux. I
sliced the hard drive from DragonFly, which I have exemplarily
described
in the [DragonFly documentation on
multiboot](
https://www.dragonflybsd.org/docs/handbook/Installation/#index6h1).
Of course, you will slice the hard drive from the first OS that you are
going to install. In the above link to the DragonFly documentation, I
have also described how the ESP is to be set up. Therefore, in the
following I assume your first OS has already been installed in its
slice, rEFInd has been installed in the ESP, and I only
consider the specifics of the OpenBSD installation.

## Installation of OpenBSD

First of all, I cannot enough recommend you to read the document 
https://ftp.openbsd.org/pub/OpenBSD/6.7/amd64/INSTALL.amd64. Of course,
this is for OpenBSD version 6.7, for a different OpenBSD version you
should update the version number accordingly.

Prepare the install medium for OpenBSD as described in the
[documentation](https://www.openbsd.org/faq/faq4.html#Download). If you
would need any additional firmware, make sure to download it to a USB
stick as [described in the documentation]
(https://www.openbsd.org/faq/faq4.html#Checklist). In my case with
OpenBSD-6.7, I had to go to http://firmware.openbsd.org/firmware/6.7/
and download the wireless driver I need (iwm-firmware-20191022p0.tgz).
Please make sure to download not only the respective *.tgz files but
also
the SHA256.sig and index.txt files and store them together in the same
folder on the USB stick as the *.tgz file(s).

Boot the computer with the install medium. In the following, I will
just
skim through the questions the installer asks that are not that obvious
how to answer (at least they weren't that obvious for me at the first
install :-))

Select (I)nstall

Do you want the X Window System to be started by xenodm? no (default)
You can always enable xenodm later. Setting no here makes sure after
booting you will be able to inspect the boot messages.

I do not configure network, because my wifi card needs the firmware to
be installed later.

Setup a user: no (default)
You can do this also after installing OpenBSD.

Which disk is the root disk: sd0
In your case the root disk maybe something else, please replace
accordingly.
Disk slicing:
We assume we have already created a disk slice for OpenBSD from the
other OS. Now we have to give that slice a type of A6, so that
the OpenBSD installer is able to recognise it. So, select your hard
drive when offered, and then select (E)dit. This will start an
interactive fdisk session. Typing p will show you the partition table.
If the partition for OpenBSD is number 2, setting its type to A6
involves the following command-line input:

e 2
t
A6
write
quit

As we are going to use rEFInd as a boot manager, you do not need to
toggle a bootable flag on the OpenBSD partition.

Note: On subsequent installs, the OpenBSD installer detects the A6
partition and readily offers it as (O)penBSD area. 

Use (W)hole disk, use the (O)penBSD area, or (E)dit the GPT: OpenBSD
Select the OpenBSD area here, which is also the default choice.

Disklabel partitioning: 
Select a custom layout: C
We want to create a custom layout for the disklabel partitions to make
sure our file systems are large enough for our needs. For example, my
OpenBSD slice is 200 GiB. First, delete all partitions (note that c
cannot be deleted):

z 

Then, I create the following layout:

Partition Size File System Mount Point
a 10g 4.2BSD/
b 16g swap
d 50g 4.2BSD/usr
e 10g 4.2BSD/var
f 15g 4.2BSD/tmp
g rest4.2BSD/home

Typing ? will help you figure out the exact commands you have to type
to
create your desired layout. When you ar

Re: openbsd multiboot

2008-05-25 Thread Jonathan Thornburg
Hi,

In message ,
I wrote
| Basically I keep a single fdisk partition containing the entire disk,
| but two sets of OpenBSD root, usr, and now var partitions inside that,
| both sharing /home and /data (where I keep my user files):
|   wd0a   rootfstab mounts root, usr, var, home, data
|   wd0b   swap
|   wd0c   entire disk
|   wd0d   root2   fstab mounts root2, usr2, var2, home, data
|   wd0e   var
|   wd0f   var2
|   wd0g   usr
|   wd0h   usr2
|   wd0j   home
|   wd0k   data
| 
| I use the standard OpenBSD bootloader; typing "boot wd0a:/bsd"
| (or just doing nothing and waiting for the 5 second default timeout)
| boots the wd0[aeg] set of partitions, while "boot wd0d:/bsd" boots
| the wd0[dfh] partitions.


On Sun, 25 May 2008, Leo Baltus wrote:
> This is still pretty obtrusive, i.e. making a backup, then
In practice, the backup takes an hour or two once every 6 months
(when the new OpenBSD comes out), which I don't find too much of a
burden.


> overwrite filesystems you normally use,

The backup (copy a,e,g to d,f,h) doesn't overwrite filesystems I
"normally use"; it overwrites a *backup* set of filesystems which
I typically haven't even mounted for some months.  That is, my wd0a
/etc/fstab mounts *only* the a,e,g,j,k partitions, so when booting
from wd0a, the d,f,h partitions are not mounted.  Similarly, my wd0d
/etc/fstab doesn't mount the a,e,g partitions.  (The idea is that
having the "other" set of partitions unmounted keeps them safe from
a great many rm-in-the-wrong-directory type sysadmin blunders.)


> hoping the backup is a copy
> you can rely on.

This is a very important point.  I completely agree, backups are
useless if I can't rely on them.  So I test them as best I can
before proceeding with an upgrade/reinstall on the a,e,g partitions.
For example, for my 4.2-stable --> 4.3-release transition, my sequence
was:
1. copy 4.2-stable a,e,g --> d,f,h, run installboot on d
2. reboot from d,f,h and use laptop normally for 4 or 5 days to make
   sure that the d,f,h 4.2-stable works normally
3. fresh install of 4.3-release on a,e,g
4. reboot from a,e,g 4.3-release, work through my usual post-install
   checklist of config file edits, packages, one or two ports, etc etc
5. use laptop normally running a,e,g 4.3-release; track down & fix any
   remaining glitches that come up (I might hand-mount d,f,h read-only
   for a while, just to have them handy for glitch-fixing)

After step 2 I don't have to just "hope" the d,f,h backup is a copy I
can rely on.  Rather, at that point I've been using the d,f,h partitions
for all my day-to-day work for 4 or 5 days, so I'm pretty confident that
they're ok.  (If they didn't work ok, then I'd want to fix the problems
before proceeding.)  Of course that "testing time" can be adjusted to
taste; it's probably more usefully measured in what-tasks-I've-done
rather than wall-clock-days.

  
> This would all be unnecessary if the bootloader could be informed that
> it should boot from wd0d:/bsd from now on, so you could leave wd0a: et.
> all unharmed. Is there really no way to do that, other than by typing it
> on the boot prompt?
> 
> Alternatively, is there a way to safely switch labels in the
> labeleditor, so that wd0a would become wd0d and vice versa?


-- 
-- "Jonathan Thornburg [remove -animal to reply]" <[EMAIL PROTECTED]>
   School of Mathematics, U of Southampton, England
   "Space travel is utter bilge" -- common misquote of UK Astronomer Royal
Richard Woolley's remarks of 1956
   "All this writing about space travel is utter bilge.  To go to the
moon would cost as much as a major war." -- what he actually said



Re: openbsd multiboot

2008-05-25 Thread Leo Baltus
Op 23/05/2008 om 15:57:52 +0100, schreef Jonathan Thornburg :
> > I would like to have more than one openbsd root filesystem on my  
> > hardrive. Could somebody please explain how to go about this?
> [[...]]
> > Using openbsd I could use multiple bios-partitions each having an a: label 
> > but how do I tel the bootloader to use a specific partition?
> 
> I have kept two copies of OpenBSD on my laptop for a long time (going
> back to 2.8, I think).  I've described my scheme in this list several
> times, eg .

I like it.

> Basically I keep a single fdisk partition containing the entire disk,
> but two sets of OpenBSD root, usr, and now var partitions inside that,
> both sharing /home and /data (where I keep my user files):
>   wd0a   rootfstab mounts root, usr, var, home, data
>   wd0b   swap
>   wd0c   entire disk
>   wd0d   root2   fstab mounts root2, usr2, var2, home, data
>   wd0e   var
>   wd0f   var2
>   wd0g   usr
>   wd0h   usr2
>   wd0j   home
>   wd0k   data
> 
> I use the standard OpenBSD bootloader; typing "boot wd0a:/bsd"
> (or just doing nothing and waiting for the 5 second default timeout)
> boots the wd0[aeg] set of partitions, while "boot wd0d:/bsd" boots
> the wd0[dfh] partitions.
> 
> I normally boot & run from the wd0[aeg] partitions; currently these
> contain OpenBSD 4.3-release, while wd0[dfh] contain 4.2-stable.  When
> I do an OS upgrade or reinstall, I only do one of the two sets of
> partitions, leaving the other unchanged as a backup.  For example,
> prior to a few weeks ago, both partition sets contained 4.2-stable;
> when I was ready to install 4.3-release I first copied (dump|restore
> and then running installboot on the wd0d /boot) the wd0[aeg] partitions
> to the wd0[dfh] partitions, and verified that I could boot & run
> normally from the wd0[dfh] partitions.  (In fact, as a test I ran
> from them for 5 days or so before finally doing the 4.3-release
> install.)  This way if anything had gone wrong with the 4.3-release
> install (nothing did), I could have aborted and rebooted from the
> wd0[dfh] ones and (still) had a working computer.

This is still pretty obtrusive, i.e. making a backup, then
overwrite filesystems you normally use, hoping the backup is a copy
you can rely on.

This would all be unnecessary if the bootloader could be informed that
it should boot from wd0d:/bsd from now on, so you could leave wd0a: et.
all unharmed. Is there really no way to do that, other than by typing it
on the boot prompt?

Alternatively, is there a way to safely switch labels in the
labeleditor, so that wd0a would become wd0d and vice versa?

-- 
Leo Baltus



Re: openbsd multiboot

2008-05-23 Thread Jonathan Thornburg
Hi,

> I would like to have more than one openbsd root filesystem on my  
> hardrive. Could somebody please explain how to go about this?
[[...]]
> Using openbsd I could use multiple bios-partitions each having an a: label 
> but how do I tel the bootloader to use a specific partition?

I have kept two copies of OpenBSD on my laptop for a long time (going
back to 2.8, I think).  I've described my scheme in this list several
times, eg .

Basically I keep a single fdisk partition containing the entire disk,
but two sets of OpenBSD root, usr, and now var partitions inside that,
both sharing /home and /data (where I keep my user files):
  wd0a   rootfstab mounts root, usr, var, home, data
  wd0b   swap
  wd0c   entire disk
  wd0d   root2   fstab mounts root2, usr2, var2, home, data
  wd0e   var
  wd0f   var2
  wd0g   usr
  wd0h   usr2
  wd0j   home
  wd0k   data

I use the standard OpenBSD bootloader; typing "boot wd0a:/bsd"
(or just doing nothing and waiting for the 5 second default timeout)
boots the wd0[aeg] set of partitions, while "boot wd0d:/bsd" boots
the wd0[dfh] partitions.

I normally boot & run from the wd0[aeg] partitions; currently these
contain OpenBSD 4.3-release, while wd0[dfh] contain 4.2-stable.  When
I do an OS upgrade or reinstall, I only do one of the two sets of
partitions, leaving the other unchanged as a backup.  For example,
prior to a few weeks ago, both partition sets contained 4.2-stable;
when I was ready to install 4.3-release I first copied (dump|restore
and then running installboot on the wd0d /boot) the wd0[aeg] partitions
to the wd0[dfh] partitions, and verified that I could boot & run
normally from the wd0[dfh] partitions.  (In fact, as a test I ran
from them for 5 days or so before finally doing the 4.3-release
install.)  This way if anything had gone wrong with the 4.3-release
install (nothing did), I could have aborted and rebooted from the
wd0[dfh] ones and (still) had a working computer.

More generally, this system gives considerable insurance against
"corrupted root partition -- computer won't even boot single-user"
problems, because by booting from the other set of partitions (e.g.
typing "boot wd0d:/bsd" at the OpenBSD "boot> " bootloader prompt),
I have a full OS available to help fix the problem.  Having man pages,
X, web browsers, etc, is really nice when debugging!

This system has saved my neck in the past.  Notably the move from
XFree86 to X.org in 4.1 was a disaster for me: X.Org didn't grok my
(then) laptop's video board, so I couldn't configure X.  I "solved"
the problem by reverting to my 2nd set of partitions and staying at
4.0 for another 6 months, then finally persuading my employer to get
me a new laptop (which X.org grokked).

ciao,

-- 
-- From: "Jonathan Thornburg [remove -animal to reply]" <[EMAIL PROTECTED]>
   School of Mathematics, U of Southampton, England
   "Open source code is not guaranteed nor does it come with a warranty."
-- the Alexis de Tocqueville Institute
   "I guess that's in contrast to proprietary software, which comes with
a money-back guarantee, and free on-site repairs if any bugs are
found." -- Rary



Re: openbsd multiboot

2008-05-21 Thread Pau
nope...

nor

terminal --silent

neither

terminal --silent console

I hate gnu

I'll play around with installboot and creating a small partition at
the very beginning of the drive and moving grub around and and and...
wish me luck

2008/5/21 Lars Noodin <[EMAIL PROTECTED]>:
> Pau wrote:
>> ... I want to have grub silent. I don't mean
>> "hide menu" but "do not display any kind of message whatsoever"
>
> Maybe use --silent ?
>http://www.gnu.org/software/grub/manual/grub.html#terminal
>
> Regards,
> -Lars



Re: openbsd multiboot

2008-05-21 Thread Lars Noodén
Pau wrote:
> ... I want to have grub silent. I don't mean
> "hide menu" but "do not display any kind of message whatsoever"

Maybe use --silent ?
http://www.gnu.org/software/grub/manual/grub.html#terminal

Regards,
-Lars



Re: openbsd multiboot

2008-05-21 Thread Pau
Hi,

interesting, I have been 1ng all day around this...

My problem is following: I want to have grub silent. I don't mean
"hide menu" but "do not display any kind of message whatsoever"
When hidding menu, you still get a "GRUB loading... " message, which I
would like to get rid of

I have: windows (5G), linux(idem) and obsd (50GB)

Does anybody know how to do this?



2008/5/21 Lars Noodin <[EMAIL PROTECTED]>:
> I've been setting up multi-boot (OpenBSD/OSX/Kubuntu) for someone else's
> Intel MacMini.  The place where I needed to pay extra attention was
> making sure that OpenBSD ended up in a primary partition.  That seems a
> bit difficult to ensure with OS X's diskutility program (which on 10.5
> gives you one shot only, once you install the system the partitions
> cannot be changed - at least with the version of OS X I have).
>
> I'm not entirely familiar with GPT v MBR.  Nor with ReFit.  Dual-boot
> OSX / OpenBSD seems to work just fine with ReFit.  So far, when going
> for triple-boot, I need to chain load OpenBSD via grub like this:
>
>title   OpenBSD
>root(hd0,2)
>makeactive
>chainloader +1
>
> Regards
> -Lars



Re: openbsd multiboot

2008-05-21 Thread Lars Noodén
I've been setting up multi-boot (OpenBSD/OSX/Kubuntu) for someone else's
Intel MacMini.  The place where I needed to pay extra attention was
making sure that OpenBSD ended up in a primary partition.  That seems a
bit difficult to ensure with OS X's diskutility program (which on 10.5
gives you one shot only, once you install the system the partitions
cannot be changed - at least with the version of OS X I have).

I'm not entirely familiar with GPT v MBR.  Nor with ReFit.  Dual-boot
OSX / OpenBSD seems to work just fine with ReFit.  So far, when going
for triple-boot, I need to chain load OpenBSD via grub like this:

title   OpenBSD
root(hd0,2)
makeactive
chainloader +1

Regards
-Lars



Re: openbsd multiboot

2008-05-21 Thread Markus Hennecke

On Wed, 21 May 2008, Chris Bennett wrote:


You may also want to have a look at GAG.
I use it to dualboot OpenBSD and Windows. Not sure if it will work with two 
OpenBSD's or not but it's very fast and easy to use.
Even booting it just off the floppy disk is super fast! I will be looking at 
having a -current and -stable box when I have some time.


The GAG page:
http://gag.sourceforge.net/


I am dual booting two OpenBSD installations from two different HDDs via 
GAG. One i386 and one amd64. They share the /usr/src and /usr/ports 
partitions so I don't have to update the sources twice.


Kind regards,
  Markus



Re: openbsd multiboot

2008-05-21 Thread Richard Daemon
On Wed, May 21, 2008 at 7:38 AM, Leo Baltus <[EMAIL PROTECTED]> wrote:
> Op 21/05/2008 om 01:10:05 +0300, schreef Imre Oolberg :
>> Some time ago i did experiment with dual-booting (actually
>> multi-booting) from one harddisk several OpenBSD instances, for the sake
>>  of fun. I settled to using dualboot OpenBSD to make upgrades more
>> suitable for me (just unpacking new distribution's file sets under /mnt
>> mounted empty partition and rebooting).
>
> Right, that's what I am aiming at.
>
>> But as i see it there is to ways of having multiple root i.e. a
>> partitions on one physical harddisk
>>
>> 1. Use only one fdisk partition and in it one OpenBSD root is normal a
>> partition and another is in the same disklabel, say g. And so for
>> example in this disklabel a, d, e, f partitions belong to one instance
>> and g is another (consisting of one filesystem). Two instances share
>> only swap partition.
>>
>> To select between them you need to say at boot> prompt
>>
>> boot> boot hd0a:/bsd
>>
>> or
>>
>> boot> boot hd0g:/bsd
>>
>> 2. Use severaly fdisk partitions, each has its own disklabel and this
>> disklabel is dedicated to one OpenBSD instance. OpenBSD bootloader is on
>>
>> To select between instances you need to use grub bootloader from binary
>> packages
>>
>> # pkg_add grub
>
> Ah, good OLD grub to the rescue. Thanks, I was staring at openbsd's
> boot, but it doesn't seem to have the configurability that e.g. grub
> has.
>
>> It goes like this that grub's first stage is in the harddisk's MBR and
>> openbsd bootloader's first stage is installed into each fdisk partition,
>>  i.e. you use chainloading.
>>
>> See also
>>
>> /usr/local/share/doc/grub/README.OpenBSD
>> /usr/local/share/examples/grub/menu.lst
>>
>> Essential is to understand that OpenBSD uses first fdisk's OpenBSD A6
>> disklabel it sees. Thats why grub fiddles with them.
>
> I am now totally confused about openbsd disk device naming schema.
>
> As I now see it /dev/wd0a refers tho the first ide disk with id 6B
> (OpenBSD), label a. As it is the one elected by boot to be the rootfs.
> It would make more sense to me to have en naming schema, which refers to
>
>wd$idedisk$partition$label
>
> Now, how can I mount, let's say, the fourth partition, on which I only
> want menu.lst to reside on. this can bee a tiny filesystem, with no OS.
>
> So I can
>mkfs /dev/$whatever
>mount /dev/$whatever /grub
>cp /usr/local/share/examples/grub/menu.lst /grub
>
> and move on.
>
>> Leo Baltus wrote:
>> >I would like to have more than one openbsd root filesystem on my
>> >hardrive. Could somebody please explain how to go about this?
>> >
>> >In a linux environment I could set up 2 lv's and point to each of them
>> >by kernel commandlines.
>> >
>> >Using openbsd I could use multiple bios-partitions each having an a: label
>> >but how do I tel the bootloader to use a specific partition?
>> >
>> >Maybe there is a way I didn't think of, please let me know.
>> >
>
> --
> Leo Baltus
>
>

Have you also considered http://gag.sourceforge.net ? Worth a look at
and very simple to setup/configure/use with almost any number of OS's
in a multiboot scenario.

Just my $0.02.



Re: openbsd multiboot

2008-05-21 Thread Chris Bennett

You may also want to have a look at GAG.
I use it to dualboot OpenBSD and Windows. Not sure if it will work with 
two OpenBSD's or not but it's very fast and easy to use.
Even booting it just off the floppy disk is super fast! I will be 
looking at having a -current and -stable box when I have some time.


The GAG page:
http://gag.sourceforge.net/

Chris Bennett

Leo Baltus wrote:

Op 21/05/2008 om 01:10:05 +0300, schreef Imre Oolberg :
  
Some time ago i did experiment with dual-booting (actually 
multi-booting) from one harddisk several OpenBSD instances, for the sake 
 of fun. I settled to using dualboot OpenBSD to make upgrades more 
suitable for me (just unpacking new distribution's file sets under /mnt 
mounted empty partition and rebooting).



Right, that's what I am aiming at.
 
  
But as i see it there is to ways of having multiple root i.e. a 
partitions on one physical harddisk


1. Use only one fdisk partition and in it one OpenBSD root is normal a 
partition and another is in the same disklabel, say g. And so for 
example in this disklabel a, d, e, f partitions belong to one instance 
and g is another (consisting of one filesystem). Two instances share 
only swap partition.


To select between them you need to say at boot> prompt

boot> boot hd0a:/bsd

or

boot> boot hd0g:/bsd

2. Use severaly fdisk partitions, each has its own disklabel and this 
disklabel is dedicated to one OpenBSD instance. OpenBSD bootloader is on


To select between instances you need to use grub bootloader from binary 
packages


# pkg_add grub



Ah, good OLD grub to the rescue. Thanks, I was staring at openbsd's
boot, but it doesn't seem to have the configurability that e.g. grub
has.

  
It goes like this that grub's first stage is in the harddisk's MBR and 
openbsd bootloader's first stage is installed into each fdisk partition, 
 i.e. you use chainloading.


See also

/usr/local/share/doc/grub/README.OpenBSD
/usr/local/share/examples/grub/menu.lst

Essential is to understand that OpenBSD uses first fdisk's OpenBSD A6 
disklabel it sees. Thats why grub fiddles with them.



I am now totally confused about openbsd disk device naming schema.

As I now see it /dev/wd0a refers tho the first ide disk with id 6B
(OpenBSD), label a. As it is the one elected by boot to be the rootfs.
It would make more sense to me to have en naming schema, which refers to

wd$idedisk$partition$label

Now, how can I mount, let's say, the fourth partition, on which I only
want menu.lst to reside on. this can bee a tiny filesystem, with no OS.

So I can 
	mkfs /dev/$whatever

mount /dev/$whatever /grub
cp /usr/local/share/examples/grub/menu.lst /grub

and move on.

  

Leo Baltus wrote:


I would like to have more than one openbsd root filesystem on my
hardrive. Could somebody please explain how to go about this?

In a linux environment I could set up 2 lv's and point to each of them
by kernel commandlines.

Using openbsd I could use multiple bios-partitions each having an a: label
but how do I tel the bootloader to use a specific partition?

Maybe there is a way I didn't think of, please let me know.




Re: openbsd multiboot

2008-05-21 Thread Leo Baltus
Op 21/05/2008 om 01:10:05 +0300, schreef Imre Oolberg :
> Some time ago i did experiment with dual-booting (actually 
> multi-booting) from one harddisk several OpenBSD instances, for the sake 
>  of fun. I settled to using dualboot OpenBSD to make upgrades more 
> suitable for me (just unpacking new distribution's file sets under /mnt 
> mounted empty partition and rebooting).

Right, that's what I am aiming at.
 
> But as i see it there is to ways of having multiple root i.e. a 
> partitions on one physical harddisk
> 
> 1. Use only one fdisk partition and in it one OpenBSD root is normal a 
> partition and another is in the same disklabel, say g. And so for 
> example in this disklabel a, d, e, f partitions belong to one instance 
> and g is another (consisting of one filesystem). Two instances share 
> only swap partition.
> 
> To select between them you need to say at boot> prompt
> 
> boot> boot hd0a:/bsd
> 
> or
> 
> boot> boot hd0g:/bsd
> 
> 2. Use severaly fdisk partitions, each has its own disklabel and this 
> disklabel is dedicated to one OpenBSD instance. OpenBSD bootloader is on
> 
> To select between instances you need to use grub bootloader from binary 
> packages
> 
> # pkg_add grub

Ah, good OLD grub to the rescue. Thanks, I was staring at openbsd's
boot, but it doesn't seem to have the configurability that e.g. grub
has.

> It goes like this that grub's first stage is in the harddisk's MBR and 
> openbsd bootloader's first stage is installed into each fdisk partition, 
>  i.e. you use chainloading.
> 
> See also
> 
> /usr/local/share/doc/grub/README.OpenBSD
> /usr/local/share/examples/grub/menu.lst
> 
> Essential is to understand that OpenBSD uses first fdisk's OpenBSD A6 
> disklabel it sees. Thats why grub fiddles with them.

I am now totally confused about openbsd disk device naming schema.

As I now see it /dev/wd0a refers tho the first ide disk with id 6B
(OpenBSD), label a. As it is the one elected by boot to be the rootfs.
It would make more sense to me to have en naming schema, which refers to

wd$idedisk$partition$label

Now, how can I mount, let's say, the fourth partition, on which I only
want menu.lst to reside on. this can bee a tiny filesystem, with no OS.

So I can 
mkfs /dev/$whatever
mount /dev/$whatever /grub
cp /usr/local/share/examples/grub/menu.lst /grub

and move on.

> Leo Baltus wrote:
> >I would like to have more than one openbsd root filesystem on my
> >hardrive. Could somebody please explain how to go about this?
> >
> >In a linux environment I could set up 2 lv's and point to each of them
> >by kernel commandlines.
> >
> >Using openbsd I could use multiple bios-partitions each having an a: label
> >but how do I tel the bootloader to use a specific partition?
> >
> >Maybe there is a way I didn't think of, please let me know.
> >

-- 
Leo Baltus



Re: openbsd multiboot

2008-05-20 Thread Imre Oolberg

Hallo!

Some time ago i did experiment with dual-booting (actually 
multi-booting) from one harddisk several OpenBSD instances, for the sake 
 of fun. I settled to using dualboot OpenBSD to make upgrades more 
suitable for me (just unpacking new distribution's file sets under /mnt 
mounted empty partition and rebooting).


But as i see it there is to ways of having multiple root i.e. a 
partitions on one physical harddisk


1. Use only one fdisk partition and in it one OpenBSD root is normal a 
partition and another is in the same disklabel, say g. And so for 
example in this disklabel a, d, e, f partitions belong to one instance 
and g is another (consisting of one filesystem). Two instances share 
only swap partition.


To select between them you need to say at boot> prompt

boot> boot hd0a:/bsd

or

boot> boot hd0g:/bsd

2. Use severaly fdisk partitions, each has its own disklabel and this 
disklabel is dedicated to one OpenBSD instance. OpenBSD bootloader is on


To select between instances you need to use grub bootloader from binary 
packages


# pkg_add grub

It goes like this that grub's first stage is in the harddisk's MBR and 
openbsd bootloader's first stage is installed into each fdisk partition, 
 i.e. you use chainloading.


See also

/usr/local/share/doc/grub/README.OpenBSD
/usr/local/share/examples/grub/menu.lst

Essential is to understand that OpenBSD uses first fdisk's OpenBSD A6 
disklabel it sees. Thats why grub fiddles with them.


Take care, it is very good oppurtunity to make your system unbootable or 
loose even more than just that!



Imre


Leo Baltus wrote:

Hi,

I would like to have more than one openbsd root filesystem on my
hardrive. Could somebody please explain how to go about this?

In a linux environment I could set up 2 lv's and point to each of them
by kernel commandlines.

Using openbsd I could use multiple bios-partitions each having an a: label
but how do I tel the bootloader to use a specific partition?

Maybe there is a way I didn't think of, please let me know.




openbsd multiboot

2008-05-20 Thread Leo Baltus
Hi,

I would like to have more than one openbsd root filesystem on my
hardrive. Could somebody please explain how to go about this?

In a linux environment I could set up 2 lv's and point to each of them
by kernel commandlines.

Using openbsd I could use multiple bios-partitions each having an a: label
but how do I tel the bootloader to use a specific partition?

Maybe there is a way I didn't think of, please let me know.

-- 
Leo Baltus