Atlantic.Net Blog

How to Configure LVM (Logical Volume Management) on DRBD (Distributed Replicated Block Device)

Paul Cortes
by Atlantic.Net (2posts) under HIPAA Compliant Database Hosting
Verified and Tested 1/20/16


This how-to will help walk you through adding LVM to DRBD. Distributed Replicated Block Device (DRBD) is a block level replication between two or more nodes and is used as a replacement for shared storage by created a networked mirror. DRBD is used in environments that require systems or data to be Highly Available.


* Two servers running Debian GNU/Linux Distribution. Other versions of Linux will work as well, but the installation packages may be different. If you need a server, you can spin up a fast and reliable cloud hosting server from in under 30 seconds.
* Both servers should be directly cross-connected together, or have a separate Network Interface for private communication.
* Both servers should have the same partitioning. This walkthrough assumes that both systems have a single /dev/sdb device that is going to be used as the
DRBD volume.

Configuring LVM on DRBD

Before we start adding LVM to DRBD you should disable the LVM cache by setting:

write_cache_state = 0

After you disable the LVM cache, make sure to remove any stale cache entries by deleting the following:


You must repeat the above steps on all DRBD nodes.

Now that we have our DRBD volume in Primary/Primary mode we need to add LVM to this device.


LVM Filters

Update your lvm.conf:

You will need to update the filter section in the LVM configuration. This needs to be done on both nodes:

nano /etc/lvm/lvm.conf

# By default we accept every block device:

filter = [ "r|/dev/sdb|", "r|/dev/disk/|", "r|/dev/block/|", "a/.*/" ]

Note: if you device is not /dev/sdb update this according to your system


Physical Volume Creation

Create the physical volume for LVM:

On one node, create the physical volume:

proxmox-host01:~# pvcreate /dev/drbd0
Physical volume "/dev/drbd0" successfully created

Check your physical volumes, they should look like similar to this:

proxmox-host01:~# pvscan
PV /dev/drbd0 lvm2 [100.00 GB]
Total: 1 [100.00 GB] / in use: 1 [100.00 GB] / in no VG: 1 [4.00 GB]


Volume Group Creation

Create the volume group:

On one node, create the volume group:

proxmox-host01:~# vgcreate vg_vm100 /dev/drbd0
Volume group "drbdvg" successfully created

Check your physical volumes again, they should look like similar to this:

proxmox-host01:~# pvscan
PV /dev/drbd0 VG vg_vm100 lvm2 [149.04 GB / 149.04 GB free]
Total: 1 [100.00 GB] / in use: 1 [100.00 GB] / in no VG: 1 [4.00 GB]

Logical Volume Creation

Create a logical volume for your VM:

proxmox-host01:~# lvcreate --name vm100 --size 50G vg_vm100

The above command will create a new 50GB Logical Volume named  vm100 and assign it to the vg_vm100 volume group. From here, you’re ready to add a new VM using your LVM as your storage partition (/dev/vg_vm100/vm100).

In order to check that things are fully working, create a new KVM VM and store the VM disk on the previously created DRBD storage.

Check out our helpful article for DRBD Replication and Configuration!


Since 1995, Atlantic.Net has been providing internet services to customers, including HIPAA compliant database hosting and managed server hosting. In 20+ years of service, our solutions have been focused on providing the very best in web solutions to our valued customers!

Start Your HIPAA Project with a Free Fully Audited HIPAA Platform Trial!

HIPAA Compliant Compute & Storage, Encrypted VPN, Security Firewall, BAA, Offsite Backups, Disaster Recovery, & More!

Start My Free Trial

Looking for HIPAA Compliant Hosting?

We Can Help with a Free Assessment.

  • IT Architecture Design, Security, & Guidance.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now!
Stevie Gold Award Med Tech Award

SOC Audit HIPAA Audit HITECH Audit

Case Studies

White Papers


HIPAA Partners

Recent Posts

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G2.1GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year

New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4


London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom