0

I’m trying to replace a disk in a TrueNAS ZFS pool and I’m getting the error cannot replace 5885333735856859460 with ada6: already in replacing/spare config; wait for completion or use 'zpool detach'

zpool status shows

    NAME                                            STATE     READ WRITE CKSUM
    Data                                            DEGRADED     0     0     0
      raidz1-0                                      ONLINE       0     0     0
        gptid/d135c3aa-526b-11e5-9e77-fcaa14286713  ONLINE       0     0     0  block size: 512B configured, 4096B native
        gptid/03f4d51c-3c63-11e5-8cea-fcaa14286713  ONLINE       0     0     0  block size: 512B configured, 4096B native
        gptid/085d91b7-9521-11e5-b5cf-fcaa14286713  ONLINE       0     0     0  block size: 512B configured, 4096B native
      raidz1-1                                      DEGRADED     0     0     0
        gptid/c6e9543f-f78d-11e2-abaa-003048d79b60  ONLINE       0     0     0
        5885333735856859460                         FAULTED      0     0     0  was /dev/gptid/c77a9a39-f78d-11e2-abaa-003048d79b60
        gptid/da5ff311-eef1-11ea-a29e-fcaa14286713  ONLINE       0     0     0  block size: 512B configured, 4096B native

errors: No known data errors

I’d previously tried the replacement through the web interface but aborted it by powering off the machine after it was locked up for a day or so, physically removed the new disk and replaced it with the original disk, and it resilvered to an error-free state. I’ve now once again physically replaced the old disk with the new disk, and I get the above error whether I try to replace the disk through the web interface or using the command line. How can I resolve it?

Rich
  • 163
  • 1
  • 6

1 Answers1

0

I managed to resolve this using the command

zpool replace -f -o ashift=9  Data 5885333735856859460 gptid/65a0a675-c080-11eb-b350-fcaa14286713

rather than

zpool replace Data 5885333735856859460 gptid/65a0a675-c080-11eb-b350-fcaa14286713

(where 65a0a675-c080-11eb-b350-fcaa14286713 is the raw ID of the data partition on the drive).

The most important clue is the message in the output of zpool status that the devices are configured with non-native block size (I don’t recall configuring the block size anywhere). The ashift parameter changes the blocksize of the device when adding it to the pool. The pool is now happily resilvering.

Rich
  • 163
  • 1
  • 6