How to add GhostBSD into grub ?

Questions about the installation of FreeBSD
Post Reply
mybsd
Posts: 1
Joined: Wed Jul 14, 2021 6:03 am

How to add GhostBSD into grub ?

Post by mybsd »

I have install two debians and win10 in my pc.

https://www.dropbox.com/s/iqbalyo46vo6n ... t.jpg?dl=0

Now i install GhostBSD in /dev/sdb2,reboot my pc, no GhostBSD in grub menu.
I have to enter into debian and run:

Code: Select all

sudo grub-mkconfig -o  /boot/grub/grub.cfg
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.19.0-17-amd64
Found initrd image: /boot/initrd.img-4.19.0-17-amd64
Found Windows Boot Manager on /dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi
Found Debian GNU/Linux 10 (buster) on /dev/sda7
Found unknown Linux distribution on /dev/sdb2
Found unknown Linux distribution on /dev/sdb5
Adding boot menu entry for EFI firmware configuration
done
All disk in my pc.

Code: Select all

sudo blkid
/dev/sda1: LABEL="Recovery" UUID="7C1443181442D534" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="56a3ab03-70cc-4e8f-a919-3ee4eb86c23f"
/dev/sda2: UUID="4A44-FBE5" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="c843589a-db0a-4b1a-826f-770f236aa1cb"
/dev/sda4: UUID="7E864DF3864DAC89" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="630aa20f-57a5-4e70-a585-b9c9a2148206"
/dev/sda5: UUID="0CB6D791B6D779A2" TYPE="ntfs" PARTUUID="84fe1bf4-5191-457f-a8e4-07ff9cedfc46"
/dev/sda6: UUID="e5a2c561-d3de-476b-8b40-4fd238563377" TYPE="swap" PARTUUID="d6ffae9b-a764-402c-96e9-83183c1b0d13"
/dev/sda7: UUID="281edc6b-687c-49e1-a5ad-fb77e9e021d4" TYPE="ext4" PARTUUID="fd8a0f56-7fd5-4f68-960e-ac30ba7e4513"
/dev/sdb1: UUID="2ededa0f-bc6f-4416-9a27-01c06e2e8be9" TYPE="ext4" PARTUUID="eb3ae1bb-01"
/dev/sdb2: UUID="60eea189683c86fa" TYPE="ufs" PTUUID="90909090" PTTYPE="dos" PARTUUID="eb3ae1bb-02"
/dev/sdb5: UUID="60eea189683c86fa" TYPE="ufs" PTUUID="90909090" PTTYPE="dos"
/dev/sdc: UUID="464D-5386" TYPE="vfat"
/dev/sda3: PARTLABEL="Microsoft reserved partition" PARTUUID="e90e67c0-8299-44c3-b7bf-287170c2885d"
grub-mkconfig can find GhostBSD ,but it is still not written into grub ,reboot ,the GhostBSD not in grub menu.
How can i write it into grub.cfg manually?
wb7odyfred
Posts: 207
Joined: Sat Nov 12, 2016 5:44 pm

Re: How to add GhostBSD into grub ?

Post by wb7odyfred »

Here is what I do manually from the "Grub >" prompt. This might give you a hint to setup in grub.cfg file. I see using partuuid identifiers above. This is good.

from the "Grub >" prompt manually enter the following 3 items to boot rEFInd boot manager. Please adjust to your particular setup of disks and partitions. I had one USB 3.0 128GB flash drve that I installed my GhostBSD from a 2nd usb flash drive that I had booted the live image from. I booted into rEFInd boot manager and selected either GhostBSD or Manjaro from there. gpt1 is the 50 megabyte FAT32 partition, gpt2 is the ZFS partition for GhostBSD data, 120+ GB gpt3 is the 8 GB swap partition

set root='(hd1,gpt2)'
chainloader (hd1,gpt1)/efi/boot/BOOTX64-REFIND.EFI
boot

http://www.rodsbooks.com/refind/ Details on the rEFInd boot manager

https://docs.freebsd.org/en/books/handbook/boot/ Chapter 13. The FreeBSD Booting Process

https://www.freebsd.org/cgi/man.cgi?que ... ormat=html boot0cfg and gpart CLI instructions


https://www.freebsd.org/cgi/man.cgi?que ... +and+Ports Gpart MAN page

GPT
In this example, we will format ada0 with the GPT scheme and create boot,
swap and root partitions. First, we need to create the partition table:

/sbin/gpart create -s GPT ada0

Next, we install a protective MBR with the first-stage bootstrap code.
The protective MBR lists a single, bootable partition spanning the entire
disk, thus allowing non-GPT-aware BIOSes to boot from the disk and pre-
venting tools which do not understand the GPT scheme from considering the
disk to be unformatted.

/sbin/gpart bootcode -b /boot/pmbr ada0

We then create a dedicated freebsd-boot partition to hold the second-
stage boot loader, which will load the FreeBSD kernel and modules from a
UFS or ZFS filesystem. This partition must be larger than the bootstrap
code (either /boot/gptboot for UFS or /boot/gptzfsboot for ZFS), but
smaller than 545 kB since the first-stage loader will load the entire
partition into memory during boot, regardless of how much data it actu-
ally contains. We create a 472-block (236 kB) boot partition at offset
40, which is the size of the partition table (34 blocks or 17 kB) rounded
up to the nearest 4 kB boundary.

/sbin/gpart add -b 40 -s 472 -t freebsd-boot ada0
/sbin/gpart bootcode -p /boot/gptboot -i 1 ada0

We now create a 4 GB swap partition at the first available offset, which
is 40 + 472 = 512 blocks (256 kB).

/sbin/gpart add -s 4G -t freebsd-swap ada0

https://docs.freebsd.org/en/books/handbook/bsdinstall/ Chapter 2. Installing FreeBSD
Post Reply