Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jun 2019 07:05:56 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Frank Fenderbender <frankfenderbender@council124.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: query re: dual-boot on two separate HDDs
Message-ID:  <20190626070556.0585d12b.freebsd@edvax.de>
In-Reply-To: <BEEA802E-BBA6-4327-A6CD-12A2BC059103@council124.org>
References:  <BEEA802E-BBA6-4327-A6CD-12A2BC059103@council124.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 25 Jun 2019 20:48:59 -0700, Frank Fenderbender wrote:
> Often, the dual-boot instructions appear to be for a same-drive,
> different partition configuration.

That is correct, because it seems to be the typical configuration.
Of course, booting from one of two (or more) physical disks is
possible.

Depending on your hardware, check if the BIOS offers a way to
choose where to boot from at system start-up time. In many cases,
there is a key assigned to this task. I'm not sure this only
covers external media (optical disks, USB drives, network, etc.),
but this could be the easiest way to go.

I'm mentioning this because I had such a Linux / FreeBSD system
in the past. You could select which drive to boot from, and each
drive had a single-system installation on it, so it would always
boot with the other disk absent. The "funny" thing was: After you
selected one drive from the BIOS to boot from, that disk became
unit 0, whereas the other one became unit 1; it could be accessed
later on from the booted system.



> So, with many well-meaning ways to botch this, I thought maybe
> someone had performed a similar sequence of steps that:
> 	adds FreeBSD to a second drive
> 	edits the GRUB/bootloader cfg file(s)
> 
> I am uncertain if Grub gets called by the BIOS call to the bootloader,
> and so, is specific to Ubuntu?

No GRUB will be called as long as the (default) requirements are
met: First disk, first partition, active, GRUB "branch", GRUB menu;
selection: continue boot from 1st disk -or- "branch" to 2nd disk's
"entry point". The FreeBSD installation on the 2nd disk would
typically contain the regular MBR boot record (no boot menu
required).

So your GRUB configuration would contain the default settings for
Ubuntu (1st choice -> 1st disk), and an additional entry for FreeBSD
(2nd choice -> 2nd disk). Technically, it doesn't matter that this
is a "real" second disk instead of just a different partition.



> I would expect it to be dealing with partition choices on one
> drive, rather than stipulating starting a boot on another drive.

Doesn't matter, just the device name changes for the "set root="
option.

Maybe this will provide some inspiration:

https://unix.stackexchange.com/questions/109272/add-freebsd-to-grub2-boot-menu/109278

https://forums.freebsd.org/threads/freebsd-and-linux-dual-boot.60407/



> Am I going to have to change the BIOS (or UEFI) boot order every time
> I want to change which OS comes up when [re]booted?

Depends.

First of all, find out if you have a BIOS or a UEFI! :-)

On the old dual-boot system I had, the "where to boot from" dialog
would come up after POST, and you could press ENTER (choice from last
time was active), or switch over to the other disks.

This is the task GRUB would be performing in your case.



> Isn't there a boot option key that will bring up a simple selection
> menu BEFORE one or another default OS has taken control?

Yes, many BIOSes (and probably UEFIs, too) have that. It's PF12 in
many cases (but not always - check the documentation of your mainboard).



> Perhaps smarter firmware?

Nonsense. This is standard stuff for more than 20 years now. :-)



> Maybe I could always have BIOS boot from a USB stick that contains
> code to toggle which is going to be considered the primary HDD, 
> acting as the director to one of two (or N) primary HDDs? I dunno,
> and reiterate, that I am currently in open eyes and ears mode.....

This also sounds possible, but inconvenient (as you would have to
make sure boot precedence would always choose that USB stick first,
before attempting to boot from one of the two disks).



> It seems to me that whatever is already sending the boot process
> to one drive, than that is where the change and menu need to exist,
> not on the one drive within its "default" boot OS; I do not want a
> default OS, if possible. I would like my menu to exist 'outside'
> of either (or "any", in the case of 2+ OS boot options) OS and
> internal hard drive.

But if you choose to use GRUB, that is quite tied to Linux anyway,
so you'll have the "GRUB partition" on the 1st disk (which is the
default load unit) that can then choose what else to boot. You can
conveniently manage its configuration from Linux, while it should
also be possible to do this from FreeBSD - but you don't configure
GRUB several times a day... ;-)



> This Dell system can handle 4 HDDs, so I could have a data HDD
> for each, keeping the OS drives clean, or add external USB HDDs
> along with two more OS internal HDDs (for instance, adding two
> more platforms as further ways of testing code for platform-independence,
> such as Project Trident, CentOS, Debian, and/or DragonflyBSD
> added to this and a second workstation).

GRUB should be totally okay to manage those.



> I am not telling Ubuntu's loader to look at a second possibility.
> I guess that what I want is the system's BIOS to provide the menu,
> read the OS boot selection, and load up an OS appropriately? Does
> that sound sane and possible?

Yes, it does. Check the documentation about whatever you have, if
the support for this feature is there.



> I hope that my understanding of what is/can be done is near-to-correct,
> and if not, appreciate steps (or a URL) that educates me and shows
> me a path of steps) which provides a near-traceover for setting this
> up.

You should at least read aboput how the booting is performed, and
which stages are encountered. For FreeBSD, "man 8 boot" provides
a good introduction. It's not much different for Linux, even with
GRUB in the mix, as I simplified (I wouldn't say "explained") a
few paragraphs above.

It's important that you make sure the "boot chain" toward FreeBSD
is complete (MBR boot sector installed, correct boot partition named,
contains loader, correct root partition named, contains kernel,
and so on). This should be the _default_ way of actions taken by
the installer "bsdinstall".



> If there are 'dual-boot' setup steps before and/or after the FreeBSD
> install, please indicate them, as well as their place in the overall
> sequence. 

There shouldn't be anything surprising... :-)




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



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