query re: dual-boot on two separate HDDs

Frank Fenderbender frankfenderbender at council124.org
Fri Jun 28 05:44:24 UTC 2019


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=(hd0,1)
 		kfreebsd /boot/kernel/kernel
		kfreebsd_loadenv /boot/device.hints
 		set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ada0s1a
	 	set kFreeBSD.vfs.root.mountfrom.options=rw
 		set kFreeBSD.hw.psm.synaptics_support=1
		}

	Add the directive at the end of the file. 
	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 
		os-prober 
		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=ufs2 /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.
> 
> 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, ...
> 

Frank
frankfenderbender at council124.org







More information about the freebsd-questions mailing list