Skip to main content
RunBook Academy

LinuxLIV · Fencing and STONITHFencing

Why fencing exists - the cluster discipline

Advanced⏱ ~10 minbash

What you'll learn

  • Explain why fencing exists
  • Describe what fencing does
  • Distinguish fencing from quorum
  • Recognise the production impact of no fencing

Prerequisites

Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09

Not yet marked complete on this device.

Fencing exists because quorum alone is not enough. This lesson covers why fencing is required and what it does.

The problem

Quorum decides who can make cluster decisions. Fencing enforces that decision.

Without fencing, even with quorum:

  • The minority group still has the workload running.
  • The minority group’s database is still mounted.
  • The minority group’s services are still serving.
  • The minority group can still write to shared storage.

If the minority group writes to shared storage while the majority group also writes, data is corrupted. Quorum prevents the decisions; fencing prevents the writes.

What fencing does

Fencing forcibly stops a node from accessing the workload:

  • Power fencing: power off the node (IPMI, BMC, iLO).
  • Storage fencing: SCSI reservations, SAN lockout.
  • Hypervisor fencing: stop the VM, undefine it.
  • Network fencing: cut the network (last resort).

After fencing, the node is guaranteed to be stopped. The storage layer can safely give the resource to another node.

Why both quorum and fencing

Quorum and fencing are complementary:

  • Quorum prevents the minority from making decisions (e.g. “promote me to primary”).
  • Fencing prevents the minority from acting (e.g. writing to storage).

Both are required. Quorum without fencing: the minority can still write. Fencing without quorum: the wrong group may be fenced.

The production impact

A cluster without fencing is a cluster waiting to corrupt data. The first partition triggers split brain; the first write after the partition corrupts data; the first restore fails.

In production, fencing is mandatory. The cost of implementing fencing is much less than the cost of a single data corruption event.

Knowledge check

Knowledge check · 3 questions

  1. Q1. Why is fencing required in addition to quorum?

  2. Q2. Fencing can be tested by killing the network cable.

  3. Q3. Which of the following are valid fencing methods? Select all that apply.

Passing score: 75%. Answers are checked in this browser.