How to Install FreeBSD 12.0 with ZFS Filesystem

FreeBSD is a free and open-source operating system derived from the Berkeley Software Distribution (BSD). It is a Unix-like operating system based on Research Unix. The first version of FreeBSD was released in 1993 and has now released the latest FreeBSD 12.0 release.

The Z file system (ZFS) is the next-generation file system originally developed by Sun Microsystem. ZFS is highly scalable with comprehensive data corruption protection, efficient data compression, native support with NFSv4 ACLs and RAID-Z, data integrity checking, and automatic repair. The ZFS was ported to the FreeBSD system in 2008.

In this tutorial, we will show you how to install the latest version of FreeBSD 12.0 on ZFS. We will use the BSDinstall, which automatically uses the entire disk for the FreeBSD system.

1. Requirements

For this guide, we will install the FreeBSD 12.0 on the virtual machine with the 2GB of RAM memory, 2 CPUs, and 25GB of Disk. If you're on production, you must use more than that. And make sure you have a FreeBSD 12.0 image and the bootable media.

Download the FreeBSD 12.0 images from this URL.

https://download.freebsd.org/ftp/releases/

2. Setup Base Installation

Insert your media bootable to your computer or server and boot the system with it. Once it's successful, just press 'Enter' to continue the installation.

FreeBSD Installer

Now select 'Install'.

Choose install mode

Choose the keyboard map with your own. If you're using the default 'US' keyboard map, you can choose 'Continue with default keymap' option and 'Select'.

Select Keymap

Setup your FreeBSD system hostname and select 'OK'.

Set hostname

Now select the base system components that you need. if you want to add an additional component, you can select the component by pressing the 'space' button on your keyboard and select 'OK'.

Select base system components

3. ZFS Configuration

Now the disk partitioning for our FreeBSD installation. Choose the 'Auto (ZFS)' partitioning method and select 'OK'.

Use ZFS Filesystem

Note:

If you want to create setup the ZFS setup manually, you can use the 'Shell' or 'Manual' options.

Now you will need to configure the ZFS for our installation. By default, the bsdinstall will create new ZFS partition with GPT as partition scheme, zpoll name as 'zroot', and the swap '2gb'.

Leave it as default and select.

Proceed with installation

The main advantages of using ZFS is when you're using RAID. So, if you're in the production environment, you can choose raidX options.

And for now, select as default 'stripe' with no redundancy and select 'OK'.

Stripe raid mode

Select your disk and 'OK'.

Choose harddisk

Select 'YES' to format and destroy the disk.

Format the disk

4. Base Installation and Setup Root Password

Now the base components installation will begin.

Extracting files

Once the base installation is complete, you will be asked to change the root password. Type your strong password.

Choose root password

5. Setup Networking

Now for the network configuration, choose your network interface and select 'OK'.

Setup networking

Select 'YES' to configure the IPv4 address of your network interface.

Configure IPv4 address

If you're using the DHCP, you can just select 'YES'. And your FreeBSD server will get the IP address from the gateway.

Configure network with DHCP

For the IPv6, you can select 'NO'.

IPv6 configuration

Now for the resolver configuration, type details with your own and select 'OK'.

DNS Resolver

6. Setup Timezone and Services

Now the timezone configuration. Choose your own region and select 'OK'.

Choose region

After that, you need to choose your details country and the timezone.

Select Country

Now choose the service that you want to activate as you need and select 'OK'.

Choose services

7. Additional Security Hardening

For the system security hardening, choose the option as you need and select 'OK'.

Security settings

8. Setup New User

Now you will be asked for adding a new user, select 'YES'.

Add new user

Type in the details for your new user.

User details

Now the configuration is complete. Choose 'exit' and select 'OK'.

Apply configuration

9. Finishing

And the FreeBSD installation on ZFS has been completed. Select 'No' for the manual configuration.

Finish the setup

Then reboot the server.

Reboot the server

Once it's complete, log in with your root user and password. Then check the installed version of FreeBSD and check the ZFS file system.

uname -msr
df -h

And you will get the result as below.

FreeBSD Booted

As a result, the FreeBSD 12.0 has been installed on the ZFS file system.

Reference

Share this page:

0 Comment(s)