The Handbook

    Theme
    • Guides
        • Check a system before installing FreeBSD
        • Orient a Linux administrator on FreeBSD
        • Supported FreeBSD releases
        • Choose a FreeBSD documentation and support channel
        • Move files safely without GNU mv -t
        • Update, upgrade, or update packages?
        • Upgrade 14.4 or 15.0 to FreeBSD 15.1
        • Choose packages, ports, or poudriere
        • Choose the quarterly or latest package branch
        • Choose a FreeBSD download or package mirror
        • Make a system setting persistent
        • Configure locale, keyboard, and time zone
        • Configure a serial console for recovery
        • Choose a custom kernel, module, or loader setting
        • Run a Linux binary with the compatibility layer
        • Check desktop and laptop hardware before installation
        • Choose and check a graphics driver
        • Choose Xorg or Wayland
        • Build a maintainable desktop baseline
        • Install and check a desktop browser
        • Check laptop Wi-Fi, power, and suspend
        • Check multimedia readiness
        • Choose and configure a printing stack
        • Run Windows applications with Wine
        • Snapshot and replicate a ZFS dataset
        • Choose a filesystem and storage layout
        • Operate ZFS without losing the recovery path
        • Restore files from a ZFS snapshot
        • Read ZFS pool health and run a scrub
        • Replace a failed device in a ZFS mirror
        • Replicate a ZFS dataset over SSH
        • Change PF safely on a remote host
        • Configure a narrow WireGuard tunnel
        • Plan a FreeBSD home server
        • Choose a mail server or an outgoing relay
        • Publish a network service safely
        • Choose a jail network model
        • Choose native jails or a jail manager
        • Choose a jail or a bhyve virtual machine
        • Establish a FreeBSD security baseline
        • Choose a MAC policy
        • Audit security-relevant activity
        • Start a DTrace performance investigation
    • Integrations
        • Create a first jail with Bastille
        • Compare jail managers and OCI tooling
        • Publish a Bastille service through PF
        • Mount a ZFS dataset in a Bastille jail
        • Update and upgrade Bastille jails
        • Back up and restore a Bastille jail
        • Prepare bhyve and vm-bhyve
        • Choose NFS or Samba for file sharing
        • Choose ZFS backup automation
        • Operate a signed poudriere repository
        • Manage FreeBSD configuration with Ansible or Salt
        • Run Motion with webcamd on FreeBSD
        • Design a reverse proxy, certificates, and monitoring
    • FAQ
      • Troubleshooting
          • Recover an interrupted freebsd-update run
          • Resolve a package repository or ABI mismatch
          • Diagnose the FreeBSD boot path
          • Recover with a ZFS boot environment
          • Diagnose DNS, routing, and firewall paths
          • Diagnose network mbuf exhaustion
          • Bind a service to a low port without running it as root
          • Diagnose audio output or input
          • Diagnose webcamd, cuse, and a webcam
          • Fix USB device permissions without opening every device
      • About this handbook
      • Synopsis
      • Confirm the topology and backup
      • Record the partition layout
      • Prepare an equivalent provider
      • Start the replacement
      • Verify completion
      • Primary references

      Replace a failed device in a ZFS mirror

      Last reviewed
      13 August 2026
      Applies to
      15.1-RELEASE, 15.0-RELEASE, 14.4-RELEASE

      Synopsis #

      This procedure is limited to replacing one failed provider in a conventional ZFS mirror that still has a healthy member. RAIDZ, special vdevs, dRAID, whole-pool migration, bootcode, encryption, and ambiguous hardware identity require a topology-specific plan.

      The dangerous part is not the zpool replace syntax. It is proving which physical device failed and which new provider is safe to overwrite.

      Confirm the topology and backup #

      Preserve the complete pool state:

      $ zpool status -P tank
      $ zpool status -g tank
      $ zpool list tank
      $ geom disk list
      

      The -P output records full provider paths. The separate -g output records ZFS vdev GUIDs, which remain useful when path names change. Preserve both views and correlate them with the physical serial number or enclosure slot before selecting a replacement target.

      Confirm all of the following before removing hardware:

      • the affected top-level vdev is a mirror;
      • another mirror member is ONLINE and readable;
      • no other vdev is degraded or unavailable;
      • an independent backup exists and can be accessed;
      • the failed provider is matched to a physical serial number or enclosure slot.

      If the pool is suspended, has permanent data errors, or has lost more redundancy than expected, stop. Replacing a device is not a substitute for a recovery assessment.

      Record the partition layout #

      Boot pools and many data pools use GPT partitions rather than whole disks. Record the healthy member’s layout and labels:

      $ gpart show
      $ gpart list
      

      The replacement must be at least large enough for the intended partition. A drive sold with the same nominal capacity can contain fewer sectors.

      Power down when the controller, enclosure, or operating procedure does not support safe hot replacement. After installing the new drive, identify it by serial and size before writing a partition table.

      Prepare an equivalent provider #

      Use the site’s recorded provisioning procedure to create the required GPT and ZFS partition on the new disk. Do not paste a device name from this guide. Verify the target immediately before every destructive gpart command.

      Prefer stable GPT labels or GPT identifiers where the existing pool uses them. The final provider passed to ZFS should represent the replacement partition, not an accidental whole disk beside it.

      Start the replacement #

      With old-provider taken from the recorded full-path pool status and correlated with the separately recorded vdev GUID, and new-provider verified from the new partition, run:

      # zpool replace tank old-provider new-provider
      $ zpool status tank
      

      ZFS begins a resilver. Monitor it without detaching the remaining healthy member:

      $ zpool status -P tank
      

      I/O errors on the surviving member during a resilver materially change the recovery risk. Preserve the status and reconsider the plan rather than repeatedly restarting commands.

      Verify completion #

      After the resilver completes:

      $ zpool status -P -v tank
      

      Confirm that every intended member is ONLINE, the resilver completed without data errors, and provider paths match the recorded layout. Run a later scrub according to the pool’s maintenance schedule; a completed resilver does not eliminate the need to investigate the original failure or validate the complete pool.

      For a boot pool, also verify the release-specific bootcode and EFI layout before treating the new disk as independently bootable. Pool redundancy and boot redundancy are related but separate properties.

      Primary references #

      • FreeBSD Handbook: ZFS administration
      • zpool-replace(8)
      • zpool-status(8)
      • gpart(8)
      • geom(8)

      Independent documentation. Not affiliated with or endorsed by the FreeBSD Project or the FreeBSD Foundation.

      Report a bug
      • Synopsis
      • Confirm the topology and backup
      • Record the partition layout
      • Prepare an equivalent provider
      • Start the replacement
      • Verify completion
      • Primary references