Preparing a multi boot install

Questions about the installation of FreeBSD
Post Reply
Posts: 2
Joined: Tue Jun 12, 2018 10:32 am

Preparing a multi boot install

Post by CuddlyOwl »

:oops: I have indeed read 1st the entries I searched on dual booting.

This question is to try to be sure I understand.

I have been using Linux since about 2007. The laptop in question is an old bios model from around 2010. Going 8 years. Nvidia 240 graphics. Intel wifi (actually died and needs replacing). How does GhostBSD handle USB connection to an Android device for network connection. (I guess someone will ask. It's a cheap Chinese brand laptop. I work in China & after problems and issues with "name brand" computers HP at the top of that list and running non Windows OS I found these computers wonderfully generic and easier to deal with. No special parts that only windows has drivers for. It's Hasee brand. Very basic.)

My lazy way to use my wifi. Last USB wifi dongle turned out to be something without support in free open source systems.

My old laptop until I replace the hard drive with an SSD already has a primary partition about 30gb set aside for BSD. Set up ages ago but I never got around to it. Now making the time. I usually use Debian based distros. Currently happy with Sparky when it comes do Debian.

In short I want to install GhostBSD into that partition. I do not want separate partitions so everything "/root" and all need to go there. I have a swap set. Can I point GhostBSD at it?

Anyone know of conflicts if both BSD & Linux are using the same swap?

I have read the installation section of GhostBSD. From my understanding I should choose the Grub for booting with Linux.

When I install if I can get all that set up. Can I install with ZFS to a partition?
The GhostBSD grub2 should find the other Linux installs? It'll automatically install to MBR?

Thanks. I read several different topics but it isn't all fully clear. I wish to clarify. Any suggestions will be very welcome.
User avatar
Posts: 18
Joined: Sat Jul 07, 2018 2:14 pm

Re: Preparing a multi boot install

Post by Powerwagon77 »

Better late than never? I'm trying to do something similar with Fedora. I'm looking to get away from SystemD. This page gives some recommendations about boot loaders: ... stallation

TL;DR Use Linux's grub. You can adapt the code at the bottom to suit your needs.

Unfortunately, I haven't been able to get the installer to complete on a physical box without using the whole disk. It's probably my fault or the fault of the not-so-great laptop I'm using. Please keep in mind that what I've written has GhostBSD installed on the first parition of the first HDD with Linux elsewhere. This can be fraught with peril.

SO, I:
1. create a VM with a disk roughly the size of (but a cat's whisker smaller [2GB]) than the partition I plan to use
2. install GhostBSD on said VM, using the WHOLE disk, selecting MBR for the "partition scheme" at the "UFS full disk configuration" screen, otherwise using all defaults, which completes successfully
3. boot the VM (after a snapshot) to bring up your bright shiny new OS and edit /etc/fstab to point to the root and swap to the partition of your physical machine
NOTE: from what I've seen Linux "sda" is BSD "ada0" and similarly, /dev/sda1 = /dev/ada0s1 In my case, I had to change /dev/label/rootfs0 to /dev/ada0s1a and /dev/label/swap0 to /dev/ada0s1b
4. reboot back into the Live CD of GhostBSD
5. use 'dd' to create an image and blow it onto the partition I want in one single step, see below.
6. I had destroyed my grub2 boot loader, so I had to boot a live cd and restore my boot loader. I could have just run as root: 'grub2-install /dev/sda'. You should probably do this 99% of the time.
NOTE: ... e-live-cd/
7. while still in Linux, edit /boot/grub2/custom.cfg to add the lines below.
NOTE: if you forgot step 3 you might be able to boot the os by typing 'ufs:/dev/ada0s1a' at the "mountpoint>" prompt

Here is step 4:
This is a hack and could seriously destroy your data, and might also destroy your love life, insult your mother and/or give you cronic halitosis. Abandon all hope ye who procede.

(because I'm lazy and stupid, stolen from ... t-over-ssh)

Linux host as root(put it on partition 1, [NOT whole disk!!] turn off your firewall)

Code: Select all

nc -l 19000|bzip2 -d|dd bs=16M of=/dev/sda1
GhostBSD VM as root, partition 1 (used whole disk, but that doesn't matter since Linux and BSD partitions schemes differ)

Code: Select all

dd bs=16M if=/dev/ada0s1|bzip2 -c|nc -q 0 MyLinuxHostnameOrIP 19000
A 38GB partition over 1 gig ethernet took me about 40 minutes

Here is step 7:
(because I'm lazy and stupid, stolen from ... -boot-menu)

Code: Select all

menuentry "GhostBSD" {
set root='(hd0,1)'
kfreebsd /boot/loader
Posts: 13
Joined: Wed Aug 01, 2018 10:33 am

Re: Preparing a multi boot install

Post by jmp20 »

I would say it may be easier to install GhostBSD and Linux dual boot this way:
1. with a blank HDD (or blank it on step 2) boot to GhBSD via your dvd/usb/iso, etc
2. assuming an 80GB hdd, with gpart create a blank slice for GhBSD root and swap, say 40 for /, and 4 swap, thus 44GB slice
3. create blank partition where Linux will reside using the left over space about 34GB in size for da0s3
4. proceed to install GhostBSD, with installer delete partition/slice 1 then allow installer to auto create partitions on slice 1. installer should be mode UFS and mbr
5. once GhBSD installation is complete, ensure to backup mbr. use dd to backup mbr to a usb stick
6. install Debian on partition 3
7. Linux/Debian grub2 should have added an entry on grub for GhostBSD. if not, add GhostBSD to Grub menu via the grug config file using a similar method to this:

Code: Select all

menuentry "GhostBSD" {
   insmod ufs2
   set root='(hd0,1)'
   kfreebsd /boot/loader
* change the hd0,X to the appropriate GhBSD partition number
8. update-grub then reboot Linux
9. GhostBSD should now be on the grub menu and should be able to boot to both, GhBSD and Linux
10. if any problems restore the mbr from backup via dd
Posts: 30
Joined: Thu Mar 18, 2021 10:40 pm

Re: Preparing a multi boot install

Post by mikethe1wheelnut »

note that this will likely only work if you have 8 gigs of ram (or more), not 4 or less. because the vm has to be installed in an operating system, so you have operating system on vm on operating system. and this will take more than 4 gigs. ..just a cautionary note for anybody considering this on an ancient (low ram) machine..
Post Reply