9

Install FreeBSD 13 on Hetzner Root Server With RAID

 2 years ago
source link: https://computingforgeeks.com/install-freebsd-on-hetzner-root-server-with-raid/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Install FreeBSD 13 on Hetzner Root Server With RAID
Search

In this article we will perform a complete installation of FreeBSD 13 operating system on Hetzner’s dedicated root server. While choosing the server specifications I recommend you read through the official hardware requirements of FreeBSD to avoid any unseen compatibility issues during the installation process. The installation of FreeBSD on Hetzner’s dedicated root servers is performed via the FreeBSD Rescue System.

FreeBSD is a very powerful operating system that powers many modern servers, desktops, and embedded platforms. The project has a large community that has continually developed it for more than thirty years. FreeBSD is very stable, secure, and with advanced networking and storage features. I’ve been a Linux veteran but keen on making some strides towards hosting of services on FreeBSD powered servers.

Follow the steps outlined in this tutorial to have a working installation of FreeBSD on Hetzner’s dedicated root server(s).

Step 1 – Boot the server in rescue mode

Login to your Hetzner Online Robot Account and select the server where this installation will be performed.

Then go the the Rescue tab and pick FreeBSD OS version that you’ll boot to rescue session with.

Select Operating system for Rescue system

Next select OS architecture and Public SSH key to be used if available.

Then Activate the rescue system. If you didn’t have public ssh key in your account you can login using root user and password printed.

Switch back to “Reset” tab and execute the automatic hardware reset of the server.

SSH into the rescue system using the IP address shown in the IPs section.

$ ssh root@serverip
Warning: Permanently added 'serverip' (ECDSA) to the list of known hosts.
Enter passphrase for key '/Users/jmutai/.ssh/id_rsa':
FreeBSD 13.0-RELEASE (GENERIC) #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:24:09 UTC 2021
-------------------------------------------------------------------

Welcome to the FreeBSD Rescue System.


To install a new FreeBSD operation system, run 'bsdinstallimage'
and follow the instructions.

More information at http://wiki.hetzner.de

-------------------------------------------------------------------


[root@rescue ~]#

Step 2 – Validate hardware specs on the server

After a successful login to the rescue system, check your current disk setup using the command below:

[root@rescue ~]# geom disk list
Geom name: ada0
Providers:
1. Name: ada0
   Mediasize: 480103981056 (447G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   descr: SAMSUNG MZ7LM480HCHP-00003
   lunid: 5002538c403064dc
   ident: S1YJNX0H603512
   rotationrate: 0
   fwsectors: 63
   fwheads: 16

Geom name: ada1
Providers:
1. Name: ada1
   Mediasize: 480103981056 (447G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   descr: SAMSUNG MZ7LM480HCHP-00003
   lunid: 5002538c403064db
   ident: S1YJNX0H603511
   rotationrate: 0
   fwsectors: 63
   fwheads: 16

Install freecolor tool that will be used to check available memory:

# pkg install freecolor

Use it to show memory capacity in the server you ordered on Hetzner:

# freecolor -m
Physical  : [##################################.] 99%	(253724/255251)

As seen the total memory capacity is255251 megabytes.

Step 3 – Initiate FreeBSD 13 installation on Hetzner Root Server

Run the installer command bsdinstallimage on the rescue system terminal to begin FreeBSD OS installation on Hetzner.

[root@rescue ~]# bsdinstallimage

Select the version of FreeBSD to install – as of this article update the choices are 13.0, 12.2, and 11.4. I’ll got with 13.0

Also select your CPU architecture

Select mirror in the next FreeBSD installation screen. Just click OK to proceed with default selection.

Step 4 – Set Keyboard map, hostname, Components to install

Choose your Keyboard map from the list or continue with the default keymap.

Set your system hostname that will be visible once you login to the server after installation. If you have a DNS server in your infrastructure map the name to an IP address that will be configured in networking section.

Choose system components to enable on your BSD server. I recommend you enable Ports tree and System source tree.

Step 5 – Configure Disk Partitions – With RAID

There are multiple options for configuring your disk partition. The easiest is the Guided root on ZFS / UFS setup. If you’re an experienced FreeBSD user you can use Manual disk setup.

For RAID configuration click on “T Pool Type/Disks

Pick your Virtual Device type of choice from the list. Note that the option selected is limited by the number of hard disks available on the server. I have two hard disks that will be configured in Stripe RAID (Level 0) for maximum capacity and zero redundancy.

Select the hard disks from the list to use in RAID configuration. I’ll select both disks:

Also choose partition table, encryption if you need to enable, Pool name, swap size e.t.c

When done proceed with the installation.

Step 6 – Install FreeBSD 13 on Hetzner dedicated server

You have to agree to data destruction before you can proceed.

Installation process begins shortly. All required distribution files are fetched by the installer.

If you have a decent internet connection the process should finish within a few minutes.

Step 7 – Configure Network Interface

Next you choose should select a network interface to configure.

Configure IP addressing for the interface – IPv4

Use DHCP or Static IP address configurations

Set search domain and DNS servers

Step 8 – Set Local Time, Timezone, Region and NTP

Select local or UTC time.

Select your timezone region. I’m in Africa.

Select your country from the list displayed after choosing the region.

Confirm country or region abbreviation.

Set date correctly as shown in my example -Year, Month and date.

Time initial configuration is also performed at the next step

Enable ntp services for automatic clock synchronization on your FreeBSD system.

Step 9 – Add Local user and set root password

Agree to add users to your newly installed FreeBSD system

Input your user information details:

FreeBSD Installer
========================
Add Users

Username: jmutai
Full name: Josphat Mutai
Uid (Leave empty for default):
Login group [jmutai]:
Login group is jmutai. Invite jmutai into other groups? []: wheel
Login class [default]:
Shell (sh csh tcsh nologin) [sh]:
Home directory [/home/jmutai]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password:
Enter password again:
Lock out the account after creation? [no]:
Username   : jmutai
Password   : *****
Full Name  : Josphat Mutai
Uid        : 1001
Class      :
Groups     : jmutai wheel
Home       : /home/jmutai
Home Mode  :
Shell      : /bin/sh
Locked     : no
OK? (yes/no): yes
adduser: INFO: Successfully added (jmutai) to the user database.
Add another user? (yes/no): no

Let’s reset root user password:

Provide and confirm the root user password:

FreeBSD Installer
========================

Please select a password for the system management account (root):
Typed characters will not be visible.
Changing local password for root
New Password: <New-Password>
Retype New Password: <Confirm-Password>

Step 10 – Download Handbook and Complete FreeBSD installation

Download FreeBSD documentation to your local FreeBSD system

Documentation is available in many languages. Choose the one that works for you.

The installation of FreeBSD on Hetzner dedicated root server is now complete.

This shell is operating in a chroot in the new system. When finished making configuration changes, type “exit”.

root@rescue:/ # exit

Perform Post installation functions to finalize the installation process.

It will mount the filesystem

Copy post-install script

Unmount filesystem

And now you have completed the installation of FreeBSD on Hetzner root server. You can safely reboot the server to start using the new operating system.

Reboot FreeBSD installed operating system:

root@rescue:/ # reboot

Wait for the server to come up then access it via SSH.

$ ssh root@serverip
Warning: Permanently added 'serverip' (ECDSA) to the list of known hosts.
Password for root@freebsd13:

You can optionally copy SSH key to the server.

ssh-copy-id root@serverip

Update and upgrade FreeBSD system:

freebsd-update fetch
freebsd-update install
pkg update
pkg upgrade

Check OS release:

# cat /etc/os-release
NAME=FreeBSD
VERSION=13.0-RELEASE
VERSION_ID=13.0
ID=freebsd
ANSI_COLOR="0;31"
PRETTY_NAME="FreeBSD 13.0-RELEASE"
CPE_NAME=cpe:/o:freebsd:freebsd:13.0
HOME_URL=https://FreeBSD.org/
BUG_REPORT_URL=https://bugs.FreeBSD.org/

Conclusion

We have covered a basic installation of FreeBSD system on Hetzner dedicate root server. You can further adjust the settings to your needs at the time of installation or after the system is installed. The official FreeBSD installation handbook can be referenced during the installation.

Recommended Books:

More resources:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK