Linux – Installing FreeBSD alongside Linux

bootdual-bootfreebsdlinuxuefi

I am using Arch Linux with GNOME, I want to install FreeBSD alongside Arch Linux with the following requirements :

  • I want to keep the Linux GRUB and add an entry of FreeBSD to it.

  • I want to use different SWAP partitions for Linux and BSD.

  • I Do not want to Destroy my Linux /boot

My System Information :

  • I am using Arch Linux : UEFI mode.
  • Disk is GPT
  • My partition Layout Looks like this :

    enter image description here

.

[severus@Tux ~]$ sudo parted -l
Model: ATA TOSHIBA MQ01ABD1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name       Flags
 1      1049kB  1076MB  1075MB  fat32           ESP        boot, esp
 2      1076MB  76.2GB  75.2GB  ext4            root
 3      76.2GB  125GB   48.3GB  ext4            home
 4      125GB   134GB   9837MB  linux-swap(v1)  swap
 5      134GB   564GB   429GB   ext4
 6      564GB   832GB   268GB   ext4
 7      832GB   914GB   82.0GB  ext4
 8      973GB   1000GB  26.8GB  ext4            CZ-Backup
  • I wish to install FreeBSD on the Un-allocated space preceding /dev/sda8

To be more precise, I am stuck at partitioning during the FreeBSD Installation process. i.e, In the Documentation, It is said that FreeBSD uses specific types of partitions ( freebsd-boot, freebsd-ufs, freebsd-swap) .

Is freebsd-boot same as EFI-System-Partition ? , Should I create a new freebsd-boot or is there any way to use the existing Linux-ESP?


I got some relevant threads, but they seems to be out-dated :

Best Answer

You can install FreeBSD alongside any linux distro with the following requirements :

  • I want to keep the Linux GRUB and add an entry of FreeBSD to it.
  • I want to use different SWAP partitions for Linux and BSD.
  • I Do not want to Destroy my Linux /boot

You need to create 3 partitions : swap: (4G) , /boot (512K) and the / partition.

To create the boot partition:

Choose Create :

  • Type : freebsd-boot
  • Size : 512k
  • Label boot

To create the swap partition :

  • Type : freebsd-swap
  • Size : 4G
  • Label : swap

To create the root partition:

  • Type : freebsd-ufs
  • Size: keep it unchanged
  • Mount point : /
  • Label : root

Choose finish then select Commit to start the installation and hit Enter.

Once the installation is done reboot into arch-linux , open the /etc/grub.d/40_custom file then add the new entry:

menuentry "FreeBSD" {
    insmod ufs2
    set root=(hd0,gpt8)
    kfreebsd /boot/loader
}

Run:

grub-mkconfig -o /boot/grub/grub.cfg

Reboot into Freebsd to install Xorg , Desktop ...

Is freebsd-boot same as EFI-System-Partition ? , Should I create a new freebsd-boot or is there any way to use the existing Linux-ESP?

You should create a new freebsd-boot partition , if you forget to add it , the installer will ask you for adding the boot partition automatically.