16.1 Dual-Boot Installation (FreeBSD Installed First)
This section covers deploying FreeBSD and Windows as a dual-boot system on the same physical device, installing FreeBSD first and then Windows.
Installing FreeBSD 14.2-RELEASE
First, install the FreeBSD 14.2-RELEASE system. Unless otherwise specified, default settings and parameters are used throughout.


Tip
If you set
P Partition SchemetoGPT (UEFI)here instead of other options (only older computers need to selectGPT (BIOS+UEFI)and similar options), the subsequent partitioning and system update process will be simpler, and 4K alignment can also be achieved.

Here you need to set a larger temporary swap partition. This value should be the sum of the planned swap partition size and the Windows system partition size. This is done so that when installing Windows later, you can directly use this space without additional partitioning operations. In this section, the swap partition size is 8 GB, and the remaining 200 GB of space is reserved for Windows. Please adjust the value of S Swap Size.
Note
The
Partition Schemepartition table should be set toGPT (uefi)! Otherwise, an extrafreebsd-bootpartition will be created.

List the system disk partition layout:
Display swap partition and swap file usage (in MB/GB):
The swap partition size is the configured 208 GB (of which 200 GB is reserved for the Windows operating system).
Edit the /etc/fstab file and add # at the beginning of the swap line to comment it out (in this example, it is the third line). This prevents the system from mounting this swap partition at boot, preparing for the subsequent Windows installation:
Installing Windows 11
After FreeBSD is installed, install the Windows system.
Insert the Windows installation media, select booting from this media in the firmware settings, and begin installing Windows. At this point, the installer will recognize the existing partition structure on the hard disk, and you can use the previously reserved space.

In the partition interface, delete (Delete Partition) the entire 208 GB swap partition (in this example, "Disk 0 Partition 3"), since this space has been reserved for Windows.

Then select Create Partition. If an error message appears, select Refresh. The Windows installer will automatically create the required partitions on the unallocated space, including the MSR partition, system partition, and recovery partition.
Select the 208 GB "Disk 0 Unallocated Space", confirm, and continue the installation.

Restoring the Swap Partition
After Windows is installed, restore the FreeBSD swap partition. The previously reserved 208 GB of space includes 8 GB for the swap partition. The following operations use the tool DiskGenius.

Launch DiskGenius and adjust the C drive partition size to release 8 GB of unallocated space. After Windows installation, the C drive occupies most of the reserved space; shrinking 8 GB from the end of the C drive is sufficient.

Set the partition type of this 8 GB space to FreeBSD Swap partition and save the changes. This step marks the newly created swap partition with a type that FreeBSD can recognize.


Return to FreeBSD and check the disk partition layout:
Partition 5 (nda0p5) is the newly created swap partition. Enable this swap partition:
No error output indicates the operation was successful, and the system has recognized and is using this swap partition.
Edit the /etc/fstab file, remove the comment symbol # from the beginning of the swap line, and change the partition to the correct value. The configuration in this example is shown on the third line:
After rebooting, check the current swap partition status again:
List all ZFS pools and their status in the system:
Last updated