KB045265 – Replacing Drives in ZFS Pool on CentOS 7

Last modified: March 24, 2021
You are here:
Estimated reading time: 1 min

Replacing Drives in ZFS Pool on CentOS 7

Scope/Description

  • This article will walk through the steps to replace a failed drive in a CentOS 7 installation through either the web UI, or through the terminal.

Prerequisites

  • Access to CentOS 7 web UI/ssh access to CentOS 7
  • Replacement Drive

Through Web UI

  • First, we’ll have to enter the ZFS tab in the web UI

  • Once here, we’ll select our pool, and then select the Status tab

  • Once in the Status tab, we’ll have to identify the failed drive, as it should be listed with either sector errors, as faulted, failed, or degraded. For this article, we’ll use drive 1-2 as the problem drive.

  • Once we’ve identified the failed drive, we’ll then have to offline this drive by clicking on the options wheel beside it, then selecting Offline Disk

  • Once it’s offline, we can then physically replace the drive itself.
  • Once it’s been replaced physically, then select the options wheel beside it, and select Replace Disk

  • Which will open the window where we select the disk to replace it with. Ensure you select to identify by Virtual Device Mapping.

  • This will begin the resilvering process with the replacement drive, which you can then monitor from the Status tab. We can see the resilver completed here, as there is little data on the pool. For a pool with more data, this time will be longer as it must reintegrate the drive into the ZFS pool.

Through Command Line

  • First, we’ll do “zpool status -v” to identify the drive with issues. For this, we’ll use drive 2-1 as the problem drive.
[root@45Drives ~]# zpool status -v

  • Then we’ll offline the drive with “zpool offline poolname drivename”
[root@45Drives ~]# zpool offline tank 2-1

  • Then, we can replace the drive physically, and once that’s done we can then replace the drive with “zpool replace poolname old drive new drive”
[root@45Drives ~]# zpool replace tank 2-1 1-2

  • Then, we can verify the drive has been replaced with “zpool status -v”

Troubleshooting

Was this article helpful?
Dislike 0
Views: 123
Unboxing Racking Storage Drives Cable Setup Power UPS Sizing Remote Access