This guide describes DRBD version 8.4 and above. For 8.3 please look here.


Chapter 10. Using LVM with DRBD

Table of Contents

10.1. LVM primer
10.2. Using a Logical Volume as a DRBD backing device
10.3. Using automated LVM snapshots during DRBD synchronization
10.4. Configuring a DRBD resource as a Physical Volume
10.5. Adding a new DRBD volume to an existing Volume Group
10.6. Nested LVM configuration with DRBD
10.6.1. Switching the VG to the other node
10.7. Highly available LVM with Pacemaker

This chapter deals with managing DRBD in conjunction with LVM2. In particular, it covers

If you happen to be unfamiliar with these terms to begin with, Section 10.1, “LVM primer” may serve as your LVM starting point — although you are always encouraged, of course, to familiarize yourself with LVM in some more detail than this section provides.

10.1. LVM primer

LVM2 is an implementation of logical volume management in the context of the Linux device mapper framework. It has practically nothing in common, other than the name and acronym, with the original LVM implementation. The old implementation (now retroactively named "LVM1") is considered obsolete; it is not covered in this section.

When working with LVM, it is important to understand its most basic concepts:

Physical Volume (PV). A PV is an underlying block device exclusively managed by LVM. PVs can either be entire hard disks or individual partitions. It is common practice to create a partition table on the hard disk where one partition is dedicated to the use by the Linux LVM.

[Note]Note

The partition type "Linux LVM" (signature 0x8E) can be used to identify partitions for exclusive use by LVM. This, however, is not required — LVM recognizes PVs by way of a signature written to the device upon PV initialization.

Volume Group (VG). A VG is the basic administrative unit of the LVM. A VG may include one or more several PVs. Every VG has a unique name. A VG may be extended during runtime by adding additional PVs, or by enlarging an existing PV.

Logical Volume (LV). LVs may be created during runtime within VGs and are available to the other parts of the kernel as regular block devices. As such, they may be used to hold a file system, or for any other purpose block devices may be used for. LVs may be resized while they are online, and they may also be moved from one PV to another (as long as the PVs are part of the same VG).

Snapshot Logical Volume (SLV). Snapshots are temporary point-in-time copies of LVs. Creating snapshots is an operation that completes almost instantly, even if the original LV (the origin volume) has a size of several hundred GiByte. Usually, a snapshot requires significantly less space than the original LV.

Figure 10.1. LVM overview

width=100%


This guide describes DRBD version 8.4 and above. For 8.3 please look here.