Our Leadership team is attending CloudFest 2026, from Mar 22 - April 8. Schedule a Connect

Our Leadership team is attending CloudFest 2026, from Mar 22 - April 8.

Discuss MSP growth, DevOps excellence, and Cloud Transformation. Available for 1:1 meetings, Schedule a Connect

  • DevOps
    Case Study

    How we helped a development company rebuild DevOps for efficiency and scale.

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How a US hosting leader scaled with us!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    Enabling financial grade platforms through strategic cloud modernisation.

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Managed Services Overview
  • Kubernetes Consulting
  • DevOps as a Service
  • Infrastructure Monitoring
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Services
  • Managed Services

aws partneraws advanced partner
LinkedInFacebookXInstagramYouTube
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy

How to setup a Network RAID aka Distributed Replicated Block Device [DRBD]

Scott S

  • 4 min read
How to setup a Network RAID aka Distributed Replicated Block Device [DRBD]

Generating audio, please wait...

Distributed Replicated Block Device (DRBD)  or network raid mirrors block devices between multiple hosts. A block device is the type of device used to represent storage in the Linux Kernel. All physical disk devices present a block device interface. DRBD mirrors a partition between two machines allowing only one of them to mount it at a time.  The replication is transparent to other applications on the host systems. Any block device hard disks, partitions, RAID devices, logical volumes, etc can be mirrored. DRBD currently supports all the major flavors of Linux and comes bundled in several major Linux distributions. DRBD is licensed under the GPL. DRBD is one of the most commonly used mirroring technique in industries\Organizations.

Here I’m configuring DRBD between two block devices /dev/sda1 and /dev/sda2 for two hosts with hostname sage1.supportsages.com(192.168.1.xxx) and sage2.supportsages.com(192.168.1.yyy) respectively having Ext4 file system. The partition size is not particularly relevant, but both partitions need to be the same size. To get started using DRBD, first, install the necessary packages on both hosts.

From a Linux terminal enter:

root@sage1:]# sudo apt-get install drbd8-utils
root@sage2:]# sudo apt-get install drbd8-utils

[Note that I’m installing drbd8-utils package on both the hosts]

If you are using the virtual kernel as part of a virtual machine you will need to manually compile the DRBD module. It will be easier to install the Linux-server package inside the virtual machine.

CONFIGURATION:

Make sure that the two hosts have name resolution configured either through DNS or the /etc/hosts file.

To configure DRBD, on the first host (sage1.supportsages.com) edit /etc/drbd.conf:

root@sage1:]# vi /etc/drbd.conf

—————————————————–
include “drbd.d/global_common.conf”;
include “drbd.d/*.res”;

resource r0 {
protocol C;
startup {
wfc-timeout 15;
degr-wfc-timeout 60;
become-primary-on sage1.supportsages.com;
}
net {
cram-hmac-alg sha1;
shared-secret “secret”;
max-buffers 8000;
max-epoch-size 8000;
sndbuf-size 0;
}
on sage1.supportsages.com {
device /dev/drbd0;
disk /dev/sda1;
address 192.168.1.xxx:7788;
meta-disk internal;
}
on sage2.supportsages.com {
device /dev/drbd0;
disk /dev/sda2;
address 192.168.1.yyy:7788;
meta-disk internal;
}
}

—————————————————–

As you can see in the above configuration that the mirroring is configured between the block device /dev/sda1 of sage1.supportsages.com and /dev/sda2 of sage2.supportsages.com. Here, device file  /dev/drbd0 is the DRBD block device.

There are many other options/configurations in /etc/drbd.conf, but for this example their default values are fine.

Now copy /etc/drbd.conf to our second host sage2.supportsages:

root@sage1:]# scp /etc/drbd.conf [email protected]:/etc/

Now using the drbdadm utility initialize the meta data storage. On each server execute:

root@sage1:]# drbdadm create-md r0
root@sage2:]# drbdadm create-md r0

Next, on both hosts, start the drbd daemon:

root@sage1:]# /etc/init.d/drbd start
root@sage2:]# /etc/init.d/drbd start

Promotional banner

On sage1.supportsages.com, or whichever host you wish to be the primary, enter the following:

root@sage1:]# drbdadm — –overwrite-data-of-peer primary all

After executing the above command, the data will start syncing with the secondary host. To watch the progress, on drbd02 enter the following:

root@sage1:]# watch -n1 cat /proc/drbd

To stop watching the output press Ctrl+c.

Now that we have a working DRBD. Its time we mount the DRBD block device to a partition and see if the mirroring is fine.

For that add a filesystem to /dev/drbd0 and mount it:
root@sage1:]# mkfs.ext4 /dev/drbd0
root@sage1:]# mount /dev/drbd0 /home

TESTING:

To test that the data is actually syncing between the hosts copy some files on the sage1.supportsages.com, the primary, to /home:

root@sage1:]# cp -r /etc/default /home

Next, unmount /home:

root@sage1:]# umount /home

Demote the primary server to the secondary role because DRBD mirrors a partition between two machines allowing only one of them to mount it at a time.

root@sage1:]# drbdadm secondary r0

Now on the secondary server(sage2.supportsages.com) promote it to the primary role:

root@sage1:]# drbdadm primary r0

Lastly, mount the partition:

root@sage2:]# mount /dev/drbd0 /home

Using ls(list) command you should see /home/default copied from the former primary host sage1.supportsages.com to the current primary sage2.supportsages.com.

For advanced building, installing and configuring DRBD follow http://www.drbd.org/docs/install .

  • General
  • Howtos
  • Linux
  • Special Offers
  • VPS
Promotional banner
Promotional banner
How to setup a Network RAID aka Distributed Replicated Block Device [DRBD]

All you want to know about Asterisk – Asterisk PBX – Part 3

All you want to know about Asterisk – Asterisk PBX – Part 3
  • Linux
logo

All you want to know about Asterisk – VoIP system architecture – Part 2

All you want to know about Asterisk – VoIP system architecture – Part 2
  • Howtos
  • Linux
logo

All you want to know about Asterisk – VoIP Fundamentals – Part 1

All you want to know about Asterisk – VoIP Fundamentals – Part 1
  • Howtos
  • Linux
logo

Asterisk Setup – Frequently Asked Questions and Answers

Asterisk Setup – Frequently Asked Questions and Answers
  • Linux
logo

Posts by Scott S

Scott follows his heart and enjoys design and implementation of advanced, sophisticated enterprise solutions. His never ending passion towards technological advancements, unyielding affinity to perfection and excitement in exploration of new areas, helps him to be on the top of everything he is involved with. This amateur bike stunting expert probably loves cars and bikes much more than his family. He currently spearheads the Enterprise Solutions and Infrastructure Consultancy wing of SupportSages.