Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Is dual booting of Linux (Manjaro) + TrueOS (ZFS) on a MBR drive using legacy boot possible?

Joined
Dec 24, 2019
Messages
4
Hello,
I've installed TrueOS on a separate disk drive but the fact that I'm trying to boot ZFS on MBR boot made things complicated for me. Till now, I've looked in grub documentation and found some solution for booting a FreeBSD-ufs on an MBR drive or a FreeBSD ZFS installation on a UEFI boot but none of these helped me to figure out if it's possible to boot TrueOS on my machine. (i.e. to boot TrueOS ZFS installation on Legacy boot: MBR drive)
I've tried this article (which tries to boot a ZFS FreeBSD installation on a UEFI machine):

and this one (that tries to load a freeBSD-ufs installation on a MBR drive)

So as the last attempt, I've created a custom.cfg file in /boot/grub/ which appears on the grub menu but won't boot due to an error that says it can't find the /boot/kernel
This is my latest grub "menuentry" inspired from the example given in GRUB's documentation page:
Note: TrueOS is installed on ada1s4a or /dev/sdb4


Code:
menuentry "TrueOS, FreeBSD" {

insmod zfs

search --set=root --label zroot --hint hd1,4

kfreebsd /freebsd@/boot/kernel/kernel

kfreebsd_module_elf /freebsd@/boot/kernel/opensolaris.ko

kfreebsd_module_elf /freebsd@/boot/kernel/zfs.ko

kfreebsd_module /freebsd@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache

set kFreeBSD.vfs.root.mountfrom=zfs:zroot/ROOT/Initial

set kFreeBSD.hw.psm.synaptics_support=1

}




Specs:
- Quad Core Intel Core i5-2500K
- 10GB RAM
- 2 HDDs (sda:160GB with manjaro installed on it. sdb:250GB: arch linux and TrueOS installed on it.)
- Linksys USB WIFI dongle (USB)
- D-Link DWL_G520 Air Xtreme WIFI card (PCI)

Thanks,
Y.
 
Joined
Dec 24, 2019
Messages
4
Here's the output of ICODE]fdisk -l[[/ICODE]:

Code:
Disk /dev/sdb: 232,91 GiB, 250059350016 bytes, 488397168 sectors
Disk model: WDC WD2500BEVS-2
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8ccd510d

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sdb1  *         2048   1435647   1433600  700M 83 Linux
/dev/sdb2         1435648   7727103   6291456    3G 82 Linux swap / Solaris
/dev/sdb3         7727104 364242943 356515840  170G 83 Linux
/dev/sdb4       364242944 488397167 124154224 59,2G a5 FreeBSD


Disk /dev/sda: 149,5 GiB, 160041885696 bytes, 312581808 sectors
Disk model: FUJITSU MHZ2160B
Units: sectors of 1 * 512 = 512 bytes
 
Joined
Dec 24, 2019
Messages
4
Here's the output of ICODE]fdisk -l[[/ICODE]:

Code:
Disk /dev/sdb: 232,91 GiB, 250059350016 bytes, 488397168 sectors
Disk model: WDC WD2500BEVS-2
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8ccd510d

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sdb1  *         2048   1435647   1433600  700M 83 Linux
/dev/sdb2         1435648   7727103   6291456    3G 82 Linux swap / Solaris
/dev/sdb3         7727104 364242943 356515840  170G 83 Linux
/dev/sdb4       364242944 488397167 124154224 59,2G a5 FreeBSD


Disk /dev/sda: 149,5 GiB, 160041885696 bytes, 312581808 sectors
Disk model: FUJITSU MHZ2160B
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x57a94aab

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048 294121765 294119718 140,3G 83 Linux
/dev/sda2       294121766 312576704  18454939   8,8G 82 Linux swap / Solaris
 
Joined
Dec 24, 2019
Messages
4
-- SOLVED -- TrueOS boot using grub on a MBR drive using legacy boot:

Contents of the /boot/grub/custom.cfg should be one of the proposed ways of booting Kernel:

A. In order to boot Kernel by loading the "bootloader" - (no bootloader menu):

---------------------------

Code:
menuentry "TrueOS, FreeBSD" {
insmod zfs
#remove "hint hd1,msdos4" it or modify it according to your drive setup
search --set=root --label zroot hint hd1,msdos4
kfreebsd /ROOT/initial/@/boot/loader
}


---------------------------



B. In order to boot Kernel directly:

---------------------------

Code:
menuentry "TrueOS, FreeBSD" {
insmod zfs
#remove "hint hd1,msdos4" it or modify it according to your drive setup
search --set=root --label zroot hint hd1,msdos4
kfreebsd /ROOT/initial@/boot/kernel/kernel
kfreebsd_module_elf /ROOT/initial@/boot/kernel/geom_eli.ko
kfreebsd_module_elf /ROOT/initial@/boot/kernel/zfs.ko
kfreebsd_module_elf /ROOT/initial@/boot/kernel/opensolaris.ko
kfreebsd_module_elf /ROOT/initial@/boot/kernel/aesni.ko
kfreebsd_module_elf /ROOT/initial@/boot/kernel/tmpfs.ko
set kFreeBSD.vfs.root.mountfrom=zfs:zroot/ROOT/initial
set kFreeBSD.hw.psm.synaptics_support=1
}


---------------------------

Good Luck!

Y.
 
Top