On Tue, Jul 16, 2024 at 09:57:20PM +0100, [email protected] wrote:
> - Install OpenBSD on the 2 drives
>       + drive1 : partition a to k for the OS
>       + drive 2: partition a to k for the OS and partition m for data
> - In UEFI, set up boot priority drive1, then drive2
> - In the OS of drive1, mount only partition m of drive2
> 
> - As long as drive1 does not fail, I enjoy the OS on drive1 and I still make
> use of drive2
> - If drive1 fails, the UEFI will automatically boot on drive2, and I can
> still enjoy the usage of the system, without having needed to access it 
> physically.
> 
> 
> Does this idea make sense?

In theory it will work.  But there are some details that you should consider:

* If drive 1 fails, there is no guarantee that the system will still boot from
  drive 2 automatically.  It depends on the way it failed, the machine could
  hang during the POST, or it might continue to attempt to boot from drive 1
  but crash after reading the first few sectors of the bootloader.

* If drive 1 fails intermittently, (such as due to a bad sata cable), you
  might boot from drive 2 once and start using that alternative OS
  installation, only to boot back in to the system on drive 1 at some point in
  the future.

* If you have any scripts or programs accessing partitions via device names
  rather than DUIDs, then be aware that these device names might change when
  booting from drive 2 with drive 1 present but failed, compared with drive 1
  present and still working, (I.E. during testing and initial setup).

> If yes, any tip on how to do it? In particular, when I install OpenBSD on
> drive2, is it better to run the openBSD installer by having booted on
> drive2, or can I just run it from OpenBSD_drive1 and select drive 2 as
> destination for the new OS?

It shouldn't matter, as long as the correct boot code is written to both drives
and you're using DUIDs everywhere instead of device names.

One detail:

>       + drive1 : partition a to k for the OS
>       + drive 2: partition a to k for the OS and partition m for data

It's not clear whether you are intending to share the 'home' partition between
the OS installs or not.

Is 'm' actually the home partition, or a separate partition for data?

The default automatic partitioning scheme in the installer creates eight
partitions from 'd' onwards, and the last one is '/home'.

If you don't have an EFI system partition on 'i', (which could be the case
despite you mentioning UEFI boot, if you are installing on a softraid crypto
volume, for example), then '/home' will end up as 'k'.  Otherwise it will
likely be 'l', (unless you have other non-OpenBSD partitions on the drives).

Sharing a single 'home' partition between the two installs is certainly
possible, but it brings various complications that you might prefer not to
deal with.  Especially in the case of drive 1 failing intermittently and
booting in to the alternative OS, then going back to the main install, if you
have application programs writing stuff to your home directory and not
expecting it to be changed by another installation of the same application,
then you could easily run in to problems.

It might be best to have a small home directory, and mount the 'm' partition
on drive 2 as /storage or something like that.  Keeping the actual home
directories separate.

Reply via email to