Disc Replacement (Help please!)

PeterSM

Dabbler
Joined
Dec 21, 2014
Messages
30
I am trying to replace a disc failed in my "Data" pool.
I haver offlined the offending disk which was a hot spare. I cannot replace the offending disk. If I use the "Force" option I get:
Code:
CallError: [EZFS_BADTARGET] can only be replaced by another hot spare

Zpool gives:
Code:
root@freenas20:~ # zpool status Data
  pool: Data
 state: DEGRADED
status: One or more devices has been taken offline by the administrator.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Online the device using 'zpool online' or replace the device with
        'zpool replace'.
  scan: scrub repaired 0B in 10:27:19 with 0 errors on Tue Feb 15 13:27:22 2022
config:

        NAME                                              STATE     READ WRITE CKSUM
        Data                                              DEGRADED     0     0     0
          raidz3-0                                        DEGRADED     0     0     0
            gptid/4bde7a13-45d2-11ea-a038-ac1f6b966338    ONLINE       0     0     0
            gptid/01100e78-0f47-11e9-bbb6-ac1f6b966338    ONLINE       0     0     0
            spare-2                                       DEGRADED     0     0     0
              gptid/8866da18-eabe-11eb-9482-ac1f6b966338  ONLINE       0     0     0
              gptid/64b05a90-0397-11e9-9d4a-ac1f6b966338  OFFLINE      0     0     0
            gptid/06cb84c6-eb8b-11eb-bef9-ac1f6b966338    ONLINE       0     0     0
            gptid/6130a320-0397-11e9-9d4a-ac1f6b966338    ONLINE       0     0     0
            gptid/625a58da-0397-11e9-9d4a-ac1f6b966338    ONLINE       0     0     0
            gptid/04ec7709-103c-11e9-a96f-ac1f6b966338    ONLINE       0     0     0
        spares
          gptid/64b05a90-0397-11e9-9d4a-ac1f6b966338      UNAVAIL   cannot open

errors: No known data errors


How do I replace the offline disk with da7?

Thanks for any help.
 

PeterSM

Dabbler
Joined
Dec 21, 2014
Messages
30
Can anyone help please I am really stuck?
 

martosio

Cadet
Joined
Mar 3, 2022
Messages
2
Can anybody confirm the idea below?
I have more or less the same issue.
Code:
    NAME                                              STATE     READ WRITE CKSUM
    pool1                                             DEGRADED     0     0     0
      raidz3-0                                        DEGRADED     0     0     0
        gptid/51d2a1f9-5540-11e9-ac80-ac1f6b4d5bbe    ONLINE       0     0     0
        gptid/52687173-5540-11e9-ac80-ac1f6b4d5bbe    ONLINE       0     0     0
        gptid/52fd74ed-5540-11e9-ac80-ac1f6b4d5bbe    ONLINE       0     0     0
        gptid/539962cd-5540-11e9-ac80-ac1f6b4d5bbe    ONLINE       0     0     0
        gptid/5567e2a4-5540-11e9-ac80-ac1f6b4d5bbe    ONLINE       0     0     0
        spare-5                                       OFFLINE      0     0     0
          6365491755288301199                         OFFLINE      0     0     0  was /dev/gptid/5603bd1b-5540-11e9-ac80-ac1f6b4d5bbe
          gptid/5b64163e-5540-11e9-ac80-ac1f6b4d5bbe  ONLINE       0     0     0
        gptid/57d9ed33-5540-11e9-ac80-ac1f6b4d5bbe    ONLINE       0     0     0
        gptid/59b4b4d7-5540-11e9-ac80-ac1f6b4d5bbe    ONLINE       0     0     0
    logs
      mirror-1                                        ONLINE       0     0     0
        ada1p1                                        ONLINE       0     0     0
        ada2p1                                        ONLINE       0     0     0
    cache
      ada1p2                                          ONLINE       0     0     0
      ada2p2                                          ONLINE       0     0     0
    spares
      9567373422039440390                             INUSE     was /dev/gptid/5b64163e-5540-11e9-ac80-ac1f6b4d5bbe


In my case, another disk went down, replaced it with the spare, and pool is still degraded. I think that I can just 'zpool detach' my offline and inuse disks (by number in my case, not gptid). I came to the forum looking for confirmation and found your post.

That being my thing.. I think you can actually do more or less the same thing. You have spare-2, which has an online device and an offline device. you should be able to detach the offline device from the pool, leaving only the online device in spare-2. After that, the status should be 'online' again. The command would be

Code:
zpool detach Data gptid/64b05a90-0397-11e9-9d4a-ac1f6b966338


Best to wait for one of the more skilled members to confirm this idea.

Cheers,
M.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I think that I can just 'zpool detach' my offline and inuse disks (by number in my case, not gptid). I came to the forum looking for confirmation and found your post.
Sounds good.

You can either detach the spare after replacing the original (dead) drive or detach the original and forgo the spare (optionally adding another now or later).
 

martosio

Cadet
Joined
Mar 3, 2022
Messages
2
Yep, indeed, worked like a charm. Thanks @sretalla , pool is online again.

@PeterSM , If you haven't fixed this yet, this should work for you:

Code:
zpool detach Data gptid/64b05a90-0397-11e9-9d4a-ac1f6b966338
To figure out which gptid is da7, you can use 'glabel status'. On my system I have redundant paths to all disk (mulipath), so it's a bit more complex. The code below still shows my boot disk though. For you, this should list disk da7 as it lists my ada0p1 boot disk.
Code:
root@nazzers[~]# glabel status
                                      Name  Status  Components
gptid/3799e7b4-553e-11e9-9e6b-ac1f6b4d5bbe     N/A  ada0p1
gptid/5b64163e-5540-11e9-ac80-ac1f6b4d5bbe     N/A  multipath/disk9p2
gptid/59b4b4d7-5540-11e9-ac80-ac1f6b4d5bbe     N/A  multipath/disk8p2
gptid/57d9ed33-5540-11e9-ac80-ac1f6b4d5bbe     N/A  multipath/disk7p2
...

Afterwards you should be able to swap the disk, and add a new spare.

Cheers,
M.
 

PeterSM

Dabbler
Joined
Dec 21, 2014
Messages
30
Sorted Many Thanks Both
 
Top