How to Install DRBD on Fedora CoreOS

DRBD (Distributed Replicated Block Device) is a high-availability storage technology that synchronizes block devices across multiple servers. In this tutorial, we will cover the steps to install DRBD on Fedora CoreOS.

Prerequisites

Step 1: Update your System

Before we get started with the DRBD installation, it’s important to update your Fedora CoreOS system to the latest version. You can do this by running the following command:

sudo dnf update -y

Step 2: Install DRBD Kernel Module

DRBD requires a kernel module to be installed on your system. Fedora CoreOS usually ships with an up-to-date kernel that includes the DRBD module, so you do not have to install it manually.

However, if you have updated your system and the DRBD kernel module is missing, you can install it using the following command:

sudo dnf install drbd-kmod -y

Step 3: Install DRBD Userspace Tools

After installing the DRBD kernel module, you need to install the DRBD userspace tools. This package includes the drbdadm utility which is used to manage DRBD devices on your system.

Use the following command to install DRBD userspace tools:

sudo dnf install drbd-utils -y

Step 4: Create DRBD Device

Before you can use DRBD, you need to create a DRBD device. You can create a DRBD device by following these steps:

  1. Create a partition on both servers that is of the same size.

  2. On one of the servers, initialize the DRBD metadata on the partition using the following command:

    sudo drbdadm create-md <resource>
    

    Replace <resource> with the name of the resource you want to create.

  3. On both servers, load the DRBD kernel module using the following command:

    sudo modprobe drbd
    
  4. On the same server where you initialized the DRBD metadata, create a new DRBD device using the following command:

    sudo drbdadm -- --overwrite-data-of-peer primary <resource>
    

    Replace <resource> with the name of the resource you created earlier.

  5. On the other server, promote the DRBD device to the primary role using the following command:

    sudo drbdadm primary <resource>
    

Step 5: Verify DRBD Status

To verify that DRBD is working correctly, check the status of the device using the following command:

sudo drbdadm status <resource>

Replace <resource> with the name of the resource you created earlier.

The output should show that the device is UpToDate, and the connection is Established.

Congratulations! You have successfully installed DRBD on your Fedora CoreOS server. You can now use DRBD to synchronize block devices across multiple servers.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!