Forcing a hot spare to become a permanent drive in pool

Alain

Cadet
Joined
Nov 17, 2020
Messages
7
I would like to force one of the hot spares to become a permanet drive member of the pool. The hot spare has already done its job and taken over the load of the failed drive. My understanding is that if I detach the failed drive from the pool the hot spare will automatically convert to a member. I get that information from here
Activating and Deactivating Hot Spares in Your Storage Pool. Section 4.10 of that page.

So I proceed to detach the drive in question using the gptid that i get from zpool status. However it tells me
"cannot detach gptid/b855c4c3-ad36-11ec-897f-0894ef030e28: only applicable to mirror and replacing vdevs"

Code:
root@truenas[~]# zpool status
  pool: Pool2
 state: DEGRADED
status: One or more devices has experienced an unrecoverable error.  An
        attempt was made to correct the error.  Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
        using 'zpool clear' or replace the device with 'zpool replace'.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-9P
  scan: resilvered 157G in 00:57:10 with 0 errors on Thu Aug 18 15:49:05 2022
config:

        NAME                                              STATE     READ WRITE CKSUM
        Pool2                                             DEGRADED     0     0     0
          raidz1-0                                        DEGRADED     0     0     0
            gptid/b355e9a9-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     0
            gptid/b3b6e36b-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     0
            spare-2                                       ONLINE       0     0     0
              gptid/b33fd603-ad36-11ec-897f-0894ef030e28  ONLINE       0     0     0
              gptid/11e8a121-ad37-11ec-897f-0894ef030e28  ONLINE       0     0     0
            gptid/b3a32a78-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     0
            gptid/b5272536-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     0
            gptid/b5b8f5fe-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     0
            gptid/b5a2a6a5-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     0
            gptid/b61101d4-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     1
            gptid/b618b82a-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     0
            gptid/b855c4c3-ad36-11ec-897f-0894ef030e28    DEGRADED     0     0     0  too many errors
            gptid/b90e1cfd-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     0
            gptid/b94a5881-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     0
            gptid/b98d0449-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     0
            gptid/b9f0ee96-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     0
            gptid/b984e3df-ad36-11ec-897f-0894ef030e28    ONLINE       0     0     0
        spares
          gptid/11e8a121-ad37-11ec-897f-0894ef030e28      INUSE     currently in use

errors: No known data errors

  pool: boot-pool
 state: ONLINE
  scan: scrub repaired 0B in 00:00:34 with 0 errors on Fri Aug 19 03:45:34 2022
config:

        NAME        STATE     READ WRITE CKSUM
        boot-pool   ONLINE       0     0     0
          da16p2    ONLINE       0     0     0

errors: No known data errors
root@truenas[~]# zpool detach Pool2  gptid/b855c4c3-ad36-11ec-897f-0894ef030e28
cannot detach gptid/b855c4c3-ad36-11ec-897f-0894ef030e28: only applicable to mirror and replacing vdevs
root@truenas[~]#


Could a super smart person tell where my thinking is wrong?
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
I think the command is remove. You remove the non-hot spare of the "spare-2", and that forces the hot spare to become permanent.
 
Top