Unable to dual- or multi-boot GhostBSD

Questions about the installation of FreeBSD
londoner
Posts: 1
Joined: Mon Jul 15, 2019 2:44 pm
Location: South Africa

Unable to dual- or multi-boot GhostBSD

Post by londoner »

Hi everyone. I am completely new to the world of BSD, but consider myself to be a fairly well-experienced user of Linux. Wanting to expand my knowledge, I recently decided to have a closer look at BSD.

I downloaded the 64-bit .iso file of GhostBSD 19.04 MATE and verified it was OK with the sha256 sum. After trying it in a VM on a laptop, I decided this was the BSD variant I wanted to use for my project.

From herein afterwards, everything was done on a desktop system with a 500 GB HDD using a GPT partition scheme. All booting and installation was done in 64-bit UEFI mode. Both Secure Boot and Fast Boot were disabled in the UEFI.

I have setup many multi-boot systems before, both with and without MS Windows. In particular, about 18 months ago I created a multi-boot system with 10 Linux distros on the same HDD. This time I decided to update that setup and add Windows and GhostBSD to the mix.

I started by installing GhostBSD on its own, first in ZFS, and then in UFS Full Disk configurations. Both times the install and booting were successful. That would seem to rule out any hardware related problems. Then, just to see what would happen, I installed Windows 10. As expected it wiped out the BSD boot loader.

Going back to my original concept, I wiped the HDD clean and added a new GPT partition table. I created a EFI System Partition (512 MiB) and a 50 GiB partition into which I installed Windows. This was successful with Windows automatically adding another hidden partition of 16 MiB.

I then proceeded to install GhostBSD in UFS Custom Disk configuration. At this stage, my partitions looked like this (please excuse the Linux terminology).

/dev/sda1 512 MiB ESP (EFI System Partition)
/dev/sda2 50 GiB Windows
/dev/sda3 16 MiB Windows (hidden reserved)
/dev/sda4 30 GiB BSD (UFS+SUJ mounted as /) ada0p4
/dev/sda5 2 GiB BSD swap ada0p5

Code: Select all

ghostbsd@livecd ~> gpart show -p
=>       34  976773101     ada0  GPT  (466G)
         34       2014           - free -  (1.0M)
       2048    1048576   ada0p1  efi  (512M)
    1050624  104857600   ada0p2  ms-basic-data  (50G)
  105908224      32768   ada0p3  ms-reserved  (16M)
  105940992   62914560   ada0p4  freebsd-ufs  (30G)
  168855552    4194304   ada0p5  freebsd-swap  (2.0G)
  173049856   41943040   ada0p6  linux-swap  (20G)
  214992896   62914063   ada0p7  linux-data  (30G)
  277906959        497           - free -  (249K)
  277907456   62914560   ada0p8  linux-data  (30G)
  340822016   62914560   ada0p9  linux-data  (30G)
  403736576   62914560  ada0p10  linux-data  (30G)
  466651136   62914560  ada0p11  linux-data  (30G)
  529565696   62914560  ada0p12  linux-data  (30G)
  592480256   62914560  ada0p13  linux-data  (30G)
  655394816   62914560  ada0p14  linux-data  (30G)
  718309376   62914560  ada0p15  linux-data  (30G)
  781223936   62914560  ada0p16  linux-data  (30G)
  844138496  132634624  ada0p17  linux-data  (63G)
  976773120         15           - free -  (7.5K)
The remainder of the HDD was left unallocated, to be used later for the Linux distros and a common data partition. The GhostBSD install appeared to be successful, but on rebooting there was no way to boot into GhostBSD. This first install was done selecting the "FreeBSD UEFI loader only". I repeated the install, this time selecting "Setup Refine boot manager" (Is this a typo? Is it meant to be the rEFInd boot manager?). I redid both installs again, with the same result. I then repeated the GhostBSD installs for a fifth and sixth time. I still couldn't boot into GhostBSD. There is no entry for it in the UEFI boot manager, no relevant folder in the ESP (but see second paragraph below), and no other type of menu to select which OS to boot.

After re-reading both the GhostBSD and FreeBSD installation guides, and fruitlessly searching this forum and the internet generally for a solution, I decided to carry on and created two more partitions, a / and a swap, into which I installed Linux Mint. In Mint I was able to mount the GhostBSD partitition (/dev/sda4). I confirmed there was a /boot folder which contained both loader & loader.efi files. Using efibootmgr I confirmed that there was no entry for GhostBSD in the UEFI, only ones for Windows and Mint.

I investigated further using Mint. After mounting the ESP, in the folder /boot/efi/EFI/Boot, there is a file refind.conf. At the tail of this is a GRUB-like entry for GhostBSD. I copied this and added it to my grub.cfg in Mint. As root, I then ran update-grub. However, this didn't work either. GRUB gave me the following:-

error: can not find command `loader'.
error: can not find command `icon'.

Updating Grub separately detects GhostBSD as an "unknown Linux distribution on /dev/sda4", but as I was already aware, this does not automatically add a menu entry. I also tried to boot using the following entries gleaned from various sources, but again none worked.

Code: Select all

menuentry "GhostBSD - refind way" {
    loader \EFI\Boot\bootx64-trueos.efi
    icon \EFI\Boot\icons\os_ghostbsd.png
}

menuentry "GhostBSD - shotgun way" {
    set root=(hd1,gpt4)
    chainloader +1
}

menuentry "GhostBSD - easy way" {
    insmod ufs2
    set root=(hd1,gpt4,a)
    kfreebsd /boot/loader
}

menuentry "GhostBSD - direct way" {
    insmod ufs2
    set root=(hd1,gpt4,a)
    search --no-floppy --fs-uuid --set 5d2a4b064b8c7824
    kfreebsd /boot/kernel/kernel
    kfreebsd_loadenv /boot/device.hints
#    kfreebsd_module /boot/splash.bmp type=splash_image_data
    set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ada0p4
    set kFreeBSD.vfs.root.mountfrom.options=rw
}
Lastly from previous experience, I know I could install the rEFInd boot manager in Linux Mint, and use that to boot GhostBSD. However I would rather not complicate the situation by adding yet another boot loader/manager to the several I have already. I would rather understand where I have been going wrong so far.

To summarize:-
1) Why could I not dual-boot GhostBSD with Windows 10? What did I miss or do wrong?
2) Can I now install a boot loader/manager from the GhostBSD LiveUSB and would that also boot Linux?
3) Could someone please give me the correct syntax of a menu entry for GhostBSD in GRUB with Linux?

Thanks in advance.
Robby000
Posts: 7
Joined: Wed Dec 30, 2020 11:34 am

Re: Unable to dual- or multi-boot GhostBSD

Post by Robby000 »

Hi Londoner,

I've got the same problem. Have you solved the problem yet?

Robby
User avatar
ericbsd
Developer
Posts: 2052
Joined: Mon Nov 19, 2012 7:54 pm

Re: Unable to dual- or multi-boot GhostBSD

Post by ericbsd »

With Grub2 you would need something like this to boot.

Code: Select all

menuentry "GhostBSD Loader" {
       insmod part_gpt
        insmod chain
        set root='(hd0,gpt1)'
        chainloader /EFI/ghostbsd/BOOTX64.EFI
}
Robby000
Posts: 7
Joined: Wed Dec 30, 2020 11:34 am

Re: Unable to dual- or multi-boot GhostBSD

Post by Robby000 »

Hi Eric,

Thanks for you response.
When I manually boot the system, the BIOS (UEFI in legacy mode) doesn't provide a boot option for GhostBSD. I tried to change the BIOS from legacy to EFI but than the system dies and I can't boot any more at all. I had to remove the battery of the PC to reset the BIOS. I've tried several ways to add a GhostBSD entry in Grub without any luck. Grub does "see" the drives GhostBSD created, but as unknown unbootable Linux drives.
Robby000
Posts: 7
Joined: Wed Dec 30, 2020 11:34 am

Re: Unable to dual- or multi-boot GhostBSD

Post by Robby000 »

Hi Eric,

Thanks for you response.
When I manually boot the system, the BIOS (UEFI in legacy mode) doesn't provide a boot option for GhostBSD. I tried to change the BIOS from legacy to EFI but than the system dies and I can't boot any more at all. I had to remove the battery of the PC to reset the BIOS. I've tried several ways to add a GhostBSD entry in Grub without any luck. Grub does "see" the drives GhostBSD created, but as unknown unbootable Linux drives.

This is how my drives look like:

/dev/sda (8.6 Mb Free space)
/dev/sda1 (250 Gb NTFS Data partion)
/dev/sdb (120 Gb SSD)
/dev/sdb1 (555 Mb NTFS MS Windows recovery)
/dev/sdb2 (105 Mb EFI System, no automount)
/dev/sdb3 (17 Mb Microsoft Reserved)
/dev/sdb4 (80 Gb NTFS Data partion)
/dev/sdb5 (40 Gb Ext4 Linux partion)
/dev/sdc (500 Gb)
/dev/sdc1 (450 Gb NTFS Data partion)
/dev/sdc2 (50 Gb tank zfs_member, partitiontype FreeBSD)
/dev/sdc5 (48 Gb tank hidden W95 FAT32)
/dev/sdc6 (2.1 Gb partiontype Ox1)
User avatar
ericbsd
Developer
Posts: 2052
Joined: Mon Nov 19, 2012 7:54 pm

Re: Unable to dual- or multi-boot GhostBSD

Post by ericbsd »

Oh for you it is a different story it will be something like this:

The example I did give was for a UEFI system on a GPT scheme driver.

If you are on the legacy it is different.

Are you on a GPT or MBR drive?
Robby000
Posts: 7
Joined: Wed Dec 30, 2020 11:34 am

Re: Unable to dual- or multi-boot GhostBSD

Post by Robby000 »

According to Windows 10
disk0 is MBR
disk1 is GPT
disk2 is MBR

I'm installing GhostBSD on sdc2, that's disk 2 so I would say MBR
Robby000
Posts: 7
Joined: Wed Dec 30, 2020 11:34 am

Re: Unable to dual- or multi-boot GhostBSD

Post by Robby000 »

I've changed the code to:

Code: Select all

menuentry "GhostBSD Loader" {
       insmod part_msdos
        set root='(hd2,2)'
       kfreebsd /boot/loader
       }
Result in "file not found"

I'm wondering if it would be better to make a dedicated grub partition first. But I'm a bit worried I will be lost half way the process and end up with a non bootable system.
Robby000
Posts: 7
Joined: Wed Dec 30, 2020 11:34 am

Re: Unable to dual- or multi-boot GhostBSD

Post by Robby000 »

After a month trying to get the system up, I came to the conclusion that GhostBSD is not ready yet for a bigger share of common PC users. The potential users are people with a need of a dual boot system at first. The installation process of GhostBSD is in need of a much better support for dual boot.
I will switch to FreeBSD. The installation process isn't better there but at least the have a bigger and more active user group.
User avatar
ericbsd
Developer
Posts: 2052
Joined: Mon Nov 19, 2012 7:54 pm

Re: Unable to dual- or multi-boot GhostBSD

Post by ericbsd »

I have not used MBR for a long time.

A proper MBR boot will look like that:

Code: Select all

menuentry "GhostBSD" {
	insmod zfs
	set root=(hd2,2,a)
	kfreebsd /boot/loader
}
The only thing I do not know if it works for ZFS.
Post Reply