Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2019 22:44:14 -0700
From:      Frank Fenderbender <frankfenderbender@council124.org>
To:        Polytropon <freebsd@edvax.de>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: query re: dual-boot on two separate HDDs
Message-ID:  <F7A29576-BA53-4CE6-9E99-CEFB145B48AD@council124.org>
In-Reply-To: <20190626070556.0585d12b.freebsd@edvax.de>
References:  <BEEA802E-BBA6-4327-A6CD-12A2BC059103@council124.org> <20190626070556.0585d12b.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for the thorough reply.
Since then, with the GRUB v2.01 running on Ubuntu 16.04, the issues with =
EUFI installed primary OSs allowing the DVD/CD reader to boot has raised =
its hydra-head. I have been dealing with this "new" Dell BIOS that =
secures 'what is' from 'what can overwrite it" to such a degree that I =
may have to get the Dell [factory] installed Ubuntu reinstalled as =
non-EUFI so that the legacy boot order becomes truly available, as =
modified now, only "BTX halted" error messages come up when either a USB =
flash drive or the DVD/CD drive are moved up to number one, above the =
primary internal [secured boot] drive.
There's some way of doing it but the "usual suspect" Ubuntu and Dell =
forums are not "filling in the blanks" as well as a contracted Dell =
support  person with system takeover can do.

The steps that most likely would have worked are as follows....
	Do it in this order:

	1. Edit your /etc/grub.d/40_custom and add uzsolt's (forum user =
whose code is listed below) directives:

		menuentry "FreeBSD" --class freebsd --class bsd --class =
os {
 		insmod ufs2
	 	insmod bsd
	 	set root=3D(hd0,1)
 		kfreebsd /boot/kernel/kernel
		kfreebsd_loadenv /boot/device.hints
 		set kFreeBSD.vfs.root.mountfrom=3Dufs:/dev/ada0s1a
	 	set kFreeBSD.vfs.root.mountfrom.options=3Drw
 		set kFreeBSD.hw.psm.synaptics_support=3D1
		}

	Add the directive at the end of the file.=20
	Don't delete anything that is in there.

	2. Make sure 40_custom is executable. If not then chmod u+x =
40_custom.

	3. Now do this to write the changes to grub.cfg.
		grub2-install /dev/sda=20
		os-prober=20
		grub2-mkconfig -o /boot/grub/grub.cfg

	4. Tada! Reboot now; you should have FreeBSD in your OS list in =
GRUB menu.

	To have access to your UFS partition slice you should do the =
following:

	1. Edit your kernel configuration to add UFS filesystem and UFS =
label.
	2. Then make && make_modules your kernel.
	3. Install the UFS filesystem software.
	4. Mount your UFS Slice under your Linux:
		/mnt/freebsd && sudo mount -r -t ufs -o ufstype=3Dufs2 =
/dev/sda1 /mnt/freebsd

Finally, commit the changes
	sudo grub-mkconfig -o /boot/grub/grub.cfg

So, after the UEFI issue is solved, I will backtrack to the above =
solution to see if it "works as advertised". ;-) Hope so.
A bg thought... if I could find a way to launch and install of the =
non-bootable/non-live FreeBSD v12.0 disk in the disk drive, then maybe I =
could bypass the boot-from-drive (refusal of live or bootable disks) =
issue. Maybe you (and/or others) have seen this on 2019 Dells, as it is =
on the web numerous times w/r/t FreeBSD, and other installs onto =
"secured" GRUB2-denying boot-install areas.

best,
"ff" (chris)


On 25-June-2019, at 10:05 PM, Polytropon wrote:

> 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.
>=20
> That is correct, because it seems to be the typical configuration.
> Of course, booting from one of two (or more) physical disks is
> possible.
>=20
> 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.
>=20
> 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.
>=20
>=20
>=20
>> 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)
>>=20
>> I am uncertain if Grub gets called by the BIOS call to the =
bootloader,
>> and so, is specific to Ubuntu?
>=20
> 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).
>=20
> 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.
>=20
>=20
>=20
>> I would expect it to be dealing with partition choices on one
>> drive, rather than stipulating starting a boot on another drive.
>=20
> Doesn't matter, just the device name changes for the "set root=3D"
> option.
>=20
> Maybe this will provide some inspiration:
>=20
> =
https://unix.stackexchange.com/questions/109272/add-freebsd-to-grub2-boot-=
menu/109278
>=20
> https://forums.freebsd.org/threads/freebsd-and-linux-dual-boot.60407/
>=20
>=20
>=20
>> 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?
>=20
> Depends.
>=20
> First of all, find out if you have a BIOS or a UEFI! :-)
>=20
> 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.
>=20
> This is the task GRUB would be performing in your case.
>=20
>=20
>=20
>> Isn't there a boot option key that will bring up a simple selection
>> menu BEFORE one or another default OS has taken control?
>=20
> Yes, many BIOSes (and probably UEFIs, too) have that. It's PF12 in
> many cases (but not always - check the documentation of your =
mainboard).
>=20
>=20
>=20
>> Perhaps smarter firmware?
>=20
> Nonsense. This is standard stuff for more than 20 years now. :-)
>=20
>=20
>=20
>> 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,=20
>> 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.....
>=20
> 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).
>=20
>=20
>=20
>> 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.
>=20
> 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... ;-)
>=20
>=20
>=20
>> 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).
>=20
> GRUB should be totally okay to manage those.
>=20
>=20
>=20
>> 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?
>=20
> Yes, it does. Check the documentation about whatever you have, if
> the support for this feature is there.
>=20
>=20
>=20
>> 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.
>=20
> 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.
>=20
> 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".
>=20
>=20
>=20
>> 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.=20
>=20
> There shouldn't be anything surprising... :-)
>=20
>=20
>=20
>=20
> --=20
> Polytropon
> Magdeburg, Germany
> Happy FreeBSD user since 4.0
> Andra moi ennepe, Mousa, ...
>=20

Frank
frankfenderbender@council124.org








Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F7A29576-BA53-4CE6-9E99-CEFB145B48AD>