This guide describes DRBD version 8.4.x. For 9.0 please look here(8.3).

Chapter 11. Using GFS2 with DRBD

Table of Contents

11.1. GFS primer
11.2. Creating a DRBD resource suitable for GFS2
11.2.1. Enable resource fencing for dual-primary resource
11.3. Configuring CMAN
11.4. Creating a GFS2 filesystem
11.5. Using your GFS2 filesystem with Pacemaker

This chapter outlines the steps necessary to set up a DRBD resource as a block device holding a shared Global File System (GFS) version 2 in a nutshell.

For a more detailed howto please consult our tech-guide on GFS in dual-primary setups.


This guide describes a dual-primary setup with DRBD. Dual-primary setups can easily destroy data if not configured properly!

Please always read our tech-guide "Dual primary: think twice", in advance, if you are planning to configure a DRBD dual-primary resource.

If you are not clear or uncertain of anything within this document you may want to consult with the friendly experts at LINBIT beforehand.

11.1. GFS primer

The Red Hat Global File System (GFS) is Red Hat’s implementation of a concurrent-access shared storage file system. As any such filesystem, GFS allows multiple nodes to access the same storage device, in read/write fashion, simultaneously without risking data corruption. It does so by using a Distributed Lock Manager (DLM) which manages concurrent access from cluster members.

GFS was designed, from the outset, for use with conventional shared storage devices. Regardless, it is perfectly possible to use DRBD, in dual-primary mode, as a replicated storage device for GFS. Applications may benefit from reduced read/write latency due to the fact that DRBD normally reads from and writes to local storage, as opposed to the SAN devices GFS is normally configured to run from. Also, of course, DRBD adds an additional physical copy to every GFS filesystem, thus adding redundancy to the concept.

GFS file systems are usually tightly integrated with Red Hat’s own cluster management framework, the Red Hat Cluster. This chapter explains the use of DRBD in conjunction with GFS in the Red Hat Cluster context. Additionally the connection to the Pacemaker cluster manager is explained, which will take care of resource management und STONITH.

GFS, Pacemaker and Red Hat Cluster are available in Red Hat Enterprise Linux (RHEL) and distributions derived from it, such as CentOS. Packages built from the same sources are also available in Debian GNU/Linux. This chapter assumes running GFS on a Red Hat Enterprise Linux system.

This guide describes DRBD version 8.4.x. For 9.0 please look here(8.3).