null

What is a ZFS Mirror?

Enterprise Resource Center • ZFS Knowledge Base

Understanding ZFS Mirrors

A ZFS mirror is a VDEV configuration that stores redundant copies of data across two or more devices. Mirrored VDEVs are commonly used when storage performance, redundancy, predictable recovery and flexible pool design are important.

Mirrored VDEV Redundancy Performance ZFS Zpool
Tech Supply Direct
Quick Answer

What Is a ZFS Mirror?

A ZFS mirror is a VDEV in which each member device contains the data needed to provide redundant storage. The most common configuration is a two-way mirror consisting of two drives.

If one device in a two-way mirror fails, the remaining mirror member can continue providing the data. ZFS also supports mirrors containing more than two devices when additional redundancy is required.

ZFS Mirrors at a Glance

ZFS Mirror Key Characteristics

REDUNDANCY

Multiple Copies

Data is redundantly stored across the devices that make up the mirrored VDEV.

MINIMUM

2 Drives

Two devices are the minimum required to create a conventional redundant ZFS mirror.

CAPACITY

~50% With 2 Drives

A two-drive mirror provides approximately the capacity of one of its drives before filesystem overhead.

PERFORMANCE

Strong Random I/O

Multiple mirrored VDEVs can provide strong random-I/O characteristics for suitable workloads.

How It Works

How a Two-Way ZFS Mirror Stores Data

In a two-way mirrored VDEV, ZFS writes the data needed to maintain an equivalent copy on each mirror member. If either device becomes unavailable, the other device can continue serving the data.

DRIVE 1
Data Copy Mirror Member
⇄
DRIVE 2
Data Copy Mirror Member
Key concept: The mirror itself is the VDEV. Multiple mirrored VDEVs can then be combined as top-level data VDEVs within the same ZFS pool.
ZFS Architecture

Mirrors, VDEVs and the ZFS Pool

Understanding the relationship between drives, VDEVs and the storage pool is essential when planning mirrored ZFS storage. Individual drives form the mirror VDEV, while one or more top-level VDEVs provide storage to the zpool.

STEP 1
Physical Drives HDDs or SSDs
STEP 2
Mirrored VDEV Redundant storage unit
STEP 3
Zpool One or more top-level VDEVs
Pool Design

Using Multiple Mirrored VDEVs

Larger mirrored pools are commonly created from multiple mirror VDEVs rather than by placing every device into one large mirror.

MIRROR VDEV 1
Drive A + Drive B
MIRROR VDEV 2
Drive C + Drive D
MIRROR VDEV 3
Drive E + Drive F
ZFS POOL
3 × Mirrored VDEVs
Capacity Planning

ZFS Mirror Usable Capacity

With equal-size drives, the usable capacity of a mirror is approximately the capacity of one mirror member because the remaining device capacity is used to maintain redundant copies.

TWO-WAY MIRROR — SIMPLIFIED CAPACITY
Usable Capacity ≈ Smallest Mirror Member

This is a simplified planning estimate. Actual filesystem capacity is lower because of drive reporting, ZFS metadata, reserved space and other storage overhead.

Configuration Raw Capacity Approx. Data Capacity Redundant Copy
2 × 4 TB 8 TB ~4 TB ~4 TB
2 × 8 TB 16 TB ~8 TB ~8 TB
2 × 16 TB 32 TB ~16 TB ~16 TB
4 × 8 TB
2 mirrored VDEVs
32 TB ~16 TB ~16 TB
6 × 12 TB
3 mirrored VDEVs
72 TB ~36 TB ~36 TB
Fault Tolerance

How Many Drives Can a ZFS Mirror Lose?

Fault tolerance is determined at the VDEV level. A two-way mirror can lose one member and continue operating. A three-way mirror can lose as many as two members, provided at least one valid mirror member remains available.

2-WAY MIRROR
1 Member May Fail One functioning member must remain.
3-WAY MIRROR
Up to 2 Members May Fail One functioning member must remain.
CRITICAL
Losing Every Member If all members of a required top-level mirror VDEV are lost, the pool can no longer rely on that VDEV.
Important ZFS Design Principle

Fault Tolerance Is Per VDEV

A pool containing several two-way mirrors does not simply have a fixed number of drive failures that can occur anywhere. Failure tolerance depends on which drives fail.

For example, a pool with three two-way mirror VDEVs could potentially survive one failed drive in each mirror. However, losing both members of the same required mirror VDEV exceeds that mirror's redundancy even if every drive in the other mirrors remains healthy.

Performance

ZFS Mirror Performance

Mirrored VDEVs are commonly considered for workloads where I/O performance is a major design priority, particularly when multiple mirror VDEVs are combined in the same pool.

Read Performance ZFS can service reads using available mirror members, giving the system opportunities to distribute read I/O.
Write Performance Writes must be committed with the redundancy required by the mirrored VDEV rather than being stored on only one mirror member.
Random I/O Pools built from multiple mirror VDEVs can provide attractive random-I/O characteristics for many transactional and virtualization workloads.
More VDEVs Adding top-level mirror VDEVs can increase available storage resources and parallelism within the pool.
Drive Replacement

Replacing a Failed Mirror Drive

When one member of a two-way mirror fails, the mirror becomes degraded but the remaining member can continue providing data. The failed device should be replaced promptly to restore the intended redundancy.

ZFS then reconstructs the required data onto the replacement device through resilvering. Mirror resilvering can be an important consideration when comparing mirrored VDEVs with parity-based RAIDZ designs.

Pool Expansion

Expanding a Pool With Additional Mirrors

One practical characteristic of mirrored pool designs is that capacity can be increased by adding another complete top-level mirror VDEV to the pool.

EXISTING POOL
2 × Mirror VDEVs
ADD
Another Mirror VDEV
EXPANDED POOL
3 × Mirror VDEVs

Expansion strategy should be planned carefully because top-level VDEV configuration affects the pool's capacity, performance and fault domains.

Mirror Types

Two-Way vs Three-Way ZFS Mirrors

Configuration Minimum Drives Approx. Capacity Efficiency Member Failures Tolerated
2-Way Mirror 2 ~50% 1 within the mirror
3-Way Mirror 3 ~33% Up to 2 within the mirror
Common Comparison

Is a ZFS Mirror the Same as RAID 1?

A two-way ZFS mirror and conventional RAID 1 share the basic concept of maintaining redundant data across two devices. However, they are not simply interchangeable names for the same storage architecture.

A ZFS mirror operates as part of ZFS and therefore participates in ZFS features such as end-to-end checksumming, copy-on-write, pooled storage, scrubbing and ZFS's integrated data-integrity mechanisms.

VDEV Selection

ZFS Mirror vs RAIDZ

Mirrors and RAIDZ represent different approaches to building redundant ZFS storage. Mirrors generally devote a larger percentage of raw capacity to redundancy but can offer advantages for random I/O, certain recovery scenarios and incremental expansion.

RAIDZ layouts can provide greater usable-capacity efficiency, particularly as VDEV width increases, while RAIDZ2 and RAIDZ3 provide multiple parity levels. The correct choice depends on workload, drive count, capacity requirements, performance targets, fault tolerance and expansion plans.

Deployment Planning

When Does a ZFS Mirror Make Sense?

Virtualization Random-I/O-heavy VM storage can be a strong candidate for pools built from multiple mirrored VDEVs.
Databases Database workloads may benefit from the I/O characteristics of appropriately designed mirror pools.
High-I/O Storage Mirrors can be attractive when IOPS and latency are more important than maximizing usable capacity.
Incremental Growth Additional complete mirror VDEVs can be added as storage requirements grow.
Tradeoffs

ZFS Mirror Advantages and Tradeoffs

ADVANTAGES
  • Simple redundancy model
  • Strong random-I/O potential
  • Fast access to redundant copies
  • Additional mirror VDEVs can expand a pool
  • Two-way and higher-order mirrors are possible
  • Well suited to many performance-oriented workloads
TRADEOFFS
  • Two-way mirrors devote roughly half of raw capacity to redundancy
  • Three-way mirrors require even more redundant capacity
  • Failure tolerance must be understood per VDEV
  • Mirrors may provide less usable capacity than RAIDZ for the same raw drive count
  • Pool topology should be planned before deployment
Important Data Protection Principle

A ZFS Mirror Is Not a Backup

Mirroring provides redundancy, but redundancy is not the same as an independent backup. A mirror can protect against specified device failures, but changes to the live filesystem are reflected through the mirrored storage.

Important data should still be protected by an appropriate backup strategy designed around the organization's recovery objectives and failure scenarios.

Frequently Asked Questions

ZFS Mirror FAQ

What is a ZFS mirror?

A ZFS mirror is a VDEV that maintains redundant data across two or more member devices.

How many drives does a ZFS mirror require?

A conventional redundant mirror requires at least two devices. ZFS can also use mirrors with additional members.

How much capacity does a two-drive mirror provide?

With equal-size drives, approximately the capacity of one drive is available before filesystem and storage overhead.

Can a ZFS mirror survive a drive failure?

A two-way mirror can tolerate one failed member as long as the other member remains available and valid.

Can ZFS use three-way mirrors?

Yes. Additional mirror members can provide additional redundancy at the cost of usable-capacity efficiency.

Is a ZFS mirror the same as RAID 1?

They share the concept of mirrored data, but a ZFS mirror is integrated into the broader ZFS storage and data-integrity architecture.

Are ZFS mirrors faster than RAIDZ?

Mirror pools can provide advantages for some random-I/O workloads, but actual performance depends on the complete pool topology, hardware and workload.

Can I add another mirror to a ZFS pool?

A complete additional top-level mirror VDEV can be added to an appropriately designed pool to increase capacity.

What happens when a mirror drive is replaced?

ZFS reconstructs the required data onto the replacement device through a process called resilvering.

Is a ZFS mirror a backup?

No. Mirroring provides redundancy against device failure; it does not create an independent backup copy.

Enterprise Storage Hardware

Building a Mirrored ZFS Storage Server?

Tech Supply Direct can help identify compatible enterprise HDDs, SSDs, SAS and SATA storage, memory and related server hardware for ZFS storage deployments, upgrades and mirrored-VDEV configurations.