Installing FreeBSD alongside Linux

9,414

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.

Share:
9,414

Related videos on Youtube

Severus Tux
Author by

Severus Tux

Updated on September 18, 2022

Comments

  • Severus Tux
    Severus Tux over 1 year

    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 :

    • Marius
      Marius over 7 years
      It may be outdated, but FreeBSD likes to be in its own partition and slice that up. Its documentation for partitioning gives an overview of GPT, but does not address your question.
  • Severus Tux
    Severus Tux over 7 years
    Thank you :) I was about to some how try using the existing /boot (ESP) thinking that it will understand everything automatically as it happens in Linux-Linux dual-boot.
  • Severus Tux
    Severus Tux over 7 years
    Oh..no! I booted into BSD and I am not seeing my free space at all !!! , only "linux-disk" (sth like that) .
  • GAD3R
    GAD3R over 7 years
    @SeverusTux Did you mean you can't mount the ext4 partitions?
  • Severus Tux
    Severus Tux over 7 years
    No, I mean I am not able to make partitions during the installation. It is showing : "linux-data" on all the partitions and "linux-swap" on the swap. Even if I delete one of the partitions, it does not show me the free space from which I could have created required partitions. (I am trying to install freeBSD 10.3)
  • GAD3R
    GAD3R over 7 years
    From Arch Linux format it as ext4 , Swap.... partition, reboot into Freebsd then re-recreate FreeBSD partitions.
  • Severus Tux
    Severus Tux over 7 years
    okay, I will try that now :)