Dual booting Linux and FreeBSD on a single drive

There is a howto on the forums on creating and using a zfs partition in multiboot by patovm04 . I've used it successfully.

 
No problems, I'll just use a other laptop for FreeBSD, if i get one anyways. Thanks for helping me guys !
 
Regarding post 66.
Edit /etc/default/grub:
Code:
GRUB_TIMEOUT=5
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
# GRUB_TIMEOUT_STYLE=hidden - comment out it
Leaving all other variables as is

I don't think that it helps a lot, at least will show the grub menu.
Still worth trying to run ./a.sh (without mounting /dev/sda3 !) and reboot
 
I'm might gonna try to have an mono boot for FreeBSD, even though whats actually concern me if the amdgpu driver works.
 
If you want to boot FreeBSD UEFI mode, an EFI System Partition is supposed to exist. I would have created one anew, even if just to make things easier, during bsdinstall: choose "manual" partitioning when asked, create a new partition, replace whatever is written as default (usually "freebsd-ufs") type with "efi", size it 512MB and set its mount point to, say, /boot/efi. After install, run a shell instead of immediately rebooting and see for yourself that /boot/efi is there, with loader.efi somewhere inside (e.g. I have /boot/efi/efi/freebsd/loader.efi here). Then reboot.

GRUB2 numbers your disks from 0 and partitions from 1. You'll need to find out these for FreeBSD root (the one you set to mount on "/" back in bsdinstall). (trial and error works fine here, just Google a bit to find out how to drop in a GRUB Shell intentionally, then try ls (hd0,gpt1)/ increasing the numbers until getting your answer).

Avoid relying on os-prober. Edit /etc/grub/40_custom as follows:
Code:
menuentry "FreeBSD" {
insmod part_gpt
insmod fat
insmod ufs2
set root=(hdX,gptY)
chainloader +1
boot
}
Replacing X and Y with the numbers figured out in previous step.

GRUB will have the right disk and partition set as root then chainload whatever is on it. If you did everything right, FreeBSD is there and will proceed with its own bootloader, there you'll have it.

Even if "+1" fails to do the trick, you must have had boot listed by ls (hdX,gptY)/ while in GRUB Rescue. Just chainloader /boot/efi/efi/freebsd/loader.efi and delete the last line ("boot") in /etc/grub/40_custom. BTW, # grubmkconfig -o /boot/grub/grub.cfg after every time you edit this file. Ignore $ update-grub for a while, though (i.e. until you have your dual-boot working).

If you didn't create the ESP and relied on the one which was already there, you'll have to check if bsdinstall behaved as I think you expected (to have put a subdirectory "freebsd" and the loader.efi there inside). That being the case, just find the partition and disk number related, set as root, and chainload the whole path to loader.efi

e.g. let's say you had a /boot/efi as ESP for xubuntu: just reapply the above logic for it (get disk and partition number, edit /etc/grub/40_custom with set root=(hdX,gptY), then chainloader /boot/efi/path/to/freebsd/loader.efi).
 
_al "Root terminal" can be a bit imprecise when environment is involved. $ sudo su, $ su -l, and $ su - yield three distinct results (as far as # env is of concern).

Not sure how is this is it? related to update-grub (a rather "Ubuntu-esque" thingy I never bothered to mince details of, like with "Debian-esque" os-prober thingy as well), though. But since you mentioned something about environments (and since sudobsd realized about the shebang line a little too late for me not to wonder how he/she interpreted/launched a "root terminal") I thought I'd better say something.
 
Back
Top