ZFS Resilvering
What Is ZFS Resilvering?
ZFS resilvering is the process of reconstructing data that ZFS knows is missing or out of date on a storage device. It commonly occurs when a failed drive is replaced, a new device is attached to a mirror, or a device returns after being unavailable.
Unlike a scrub, which examines all allocated data to verify checksums and search for errors, a normal resilver focuses on data ZFS already knows needs to be brought up to date.
ZFS Resilvering at a Glance
How Does ZFS Resilvering Work?
ZFS tracks which portions of a device require reconstruction. During a normal healing resilver, ZFS identifies data that is known to be out of date, reads the required information from surviving redundant storage and reconstructs that data onto the affected device.
Replacing a Failed Drive in a ZFS Mirror
Healthy Mirror
Degraded Mirror
Resilvering
Replacing a Drive and Starting a Resilver
A common replacement operation uses zpool replace. When a device is replaced, ZFS automatically begins the resilvering process required to populate the replacement.
Device identifiers differ by operating system and storage configuration. Administrators should verify the exact failed and replacement device before issuing a replacement command.
What If the New Drive Uses the Same Device Path?
If a failed physical drive has already been removed and its replacement appears under the same device path, OpenZFS can use the replacement form without specifying a second device.
How to Check ZFS Resilver Progress
The primary command for monitoring pool health and an active resilver is zpool status.
Exact status output varies by OpenZFS version, platform, pool layout and workload. Progress percentages and completion estimates are approximate.
What Determines ZFS Resilver Time?
There is no universal resilver time. Reconstruction speed depends on the pool, devices, data layout and competing workload.
A Resilvering Pool May Still Have Reduced Redundancy
Starting a resilver does not mean redundancy has already been restored. Until enough required data has been reconstructed, the affected vdev may remain degraded and have less failure tolerance than it normally provides.
Additional device failures or unreadable data during this period can therefore be more consequential. Administrators should monitor pool status and address failing hardware promptly.
Mirror vs RAIDZ Resilvering
Copy From Surviving Mirror Data
In a mirrored vdev, another mirror member provides redundant copies of the data required to populate the replacement device.
Reconstruct From RAIDZ Redundancy
In RAIDZ, ZFS reconstructs missing data using the surviving data and parity information available within the RAIDZ vdev.
ZFS Resilver vs ZFS Scrub
Resilvering and scrubbing use related ZFS scanning machinery, but they serve different purposes.
| Feature | Resilver | Scrub |
|---|---|---|
| Primary Purpose | Restore out-of-date data | Verify pool data |
| Typical Trigger | Replacement or returning device | Scheduled or manual integrity check |
| Data Examined | Data known to require updating | All allocated data |
| Can Repair? | Reconstructs required redundant data | Can repair detected damage when valid redundancy exists |
| I/O Intensive? | Yes | Yes |
Sequential Reconstruction
Supported OpenZFS configurations can use sequential reconstruction when attaching or replacing a device. Instead of immediately performing checksum-verifying healing reconstruction, the new device is rebuilt sequentially to restore redundancy more quickly.
General ZFS Drive Replacement Process
Understanding READ, WRITE and CKSUM Errors
When checking zpool status, administrators should pay attention to the per-device error counters.
Verify the Physical Drive Before Removing Hardware
Device names such as sda, sdb or other operating system identifiers should not be assumed to correspond to a particular physical bay without verification.
Removing the wrong healthy member from an already degraded vdev can reduce redundancy further and may cause data loss if the remaining redundancy is insufficient.
ZFS Resilvering Best Practices
ZFS Resilvering FAQ
What does resilvering mean in ZFS?
Resilvering reconstructs data ZFS knows is missing or out of date on a replacement, attached or returning storage device.
Does ZFS automatically resilver a replacement drive?
Yes. Once the appropriate replacement or attachment operation is performed, ZFS begins the required reconstruction automatically.
How do I check ZFS resilver progress?
Use zpool status. It reports an active resilver and provides approximate progress and completion information.
How long does a ZFS resilver take?
Resilver time depends on the amount of data requiring reconstruction, device performance, vdev layout, fragmentation and active workload.
Is a ZFS resilver the same as a scrub?
No. A resilver reconstructs data ZFS knows is out of date, while a scrub examines allocated pool data to verify checksums and discover integrity problems.
Can I use the ZFS pool during resilvering?
A functioning degraded pool can continue serving workloads while resilvering, although performance may be affected and redundancy may remain reduced.
Does resilvering read the entire drive?
A normal resilver focuses on data ZFS knows needs to be brought up to date rather than treating the operation as a blind sector-for-sector copy of the entire device.
What happens if another drive fails during resilvering?
The result depends on the vdev layout and remaining redundancy. If failures exceed the redundancy provided by the affected vdev, data may become unavailable or unrecoverable.
Is sequential resilvering supported on RAIDZ?
OpenZFS sequential reconstruction using the -s replacement or attach option is not supported for RAIDZ configurations.
