GUI Can't reconize the disk replaced by command line

OS: TrueNAS-13.3-RELEASE

A disk(/dev/da16) broken, I replaced it by command line:

## the /dev/da16 just offline, it's broken completely

## insert the new disk
gpart create -s gpt /dev/da16
gpart add -a 4k -t freebsd-zfs /dev/da16

gpart list /dev/da16 | grep rawuuid
>  ccbf312f-9fff-11ef-9be0-e41d2ddf3480

zpool replace MainPool /dev/gptid/c752a49f-4f45-432e-80c6-9cc777363f49 /dev/gptid/ccbf312f-9fff-11ef-9be0-e41d2ddf3480

zpool status -P
  pool: MainPool
 state: ONLINE
  scan: resilvered 3.01T in 17:57:13 with 0 errors on Wed Nov 13 08:49:28 2024
config:

        NAME                                                 STATE     READ WRITE CKSUM
        MainPool                                             ONLINE       0     0     0
          raidz3-0                                           ONLINE       0     0     0
            /dev/gptid/a9e39c43-b5e4-4e34-9a06-20abe4f2300d  ONLINE       0     0     0
            /dev/gptid/b57b4a7e-a732-49d1-83c5-ed38acacb515  ONLINE       0     0     0
            /dev/gptid/004dad74-dfaf-4c6a-a120-3f7b1042dc21  ONLINE       0     0     0
            /dev/gptid/a27a39a2-40e1-465b-ba92-e822339da2de  ONLINE       0     0     0
            /dev/gptid/947fb5f1-a0c2-11ef-9be0-e41d2ddf3480  ONLINE       0     0     0
            /dev/gptid/67e4d1b7-2574-48bc-817c-8cbc4ebdf71e  ONLINE       0     0     0
            /dev/gptid/29c0f0ff-ca25-4d70-9635-18d43e50bcff  ONLINE       0     0     0
            /dev/gptid/7d76885c-4df1-45fa-9d51-7f8e2e7bf788  ONLINE       0     0     0
            /dev/gptid/9a005094-c661-4dba-ab6d-aab55d50efae  ONLINE       0     0     0
            /dev/gptid/0947cf61-d984-48de-be59-39509be08ec5  ONLINE       0     0     0
            /dev/gptid/8d8bb7c2-23b3-49a9-8170-2cd1a8f851bf  ONLINE       0     0     0
            /dev/gptid/71694af4-9951-4b53-b6da-d97b9e677897  ONLINE       0     0     0
            /dev/gptid/a02ab1fa-fb3f-46b6-b2ec-014dab3abf7b  ONLINE       0     0     0
            /dev/gptid/472a3d2c-bc1f-43b5-92f3-5d46a09bfb8a  ONLINE       0     0     0
            /dev/gptid/501740fe-022e-4ef6-9522-c46619f109b4  ONLINE       0     0     0
            /dev/gptid/ccbf312f-9fff-11ef-9be0-e41d2ddf3480  ONLINE       0     0     0
            /dev/gptid/d76cc3de-d18c-4baf-8e07-7af52ad2f6fe  ONLINE       0     0     0
            /dev/gptid/e85c464a-68fa-436a-a519-af522f7fe7af  ONLINE       0     0     0
        cache
          /dev/gptid/38507aed-9e5f-11ef-9be0-e41d2ddf3480    ONLINE       0     0     0
          /dev/gptid/3854d11c-9e5f-11ef-9be0-e41d2ddf3480    ONLINE       0     0     0

errors: No known data errors

But the GUI can’t reconize the disk replaced by my self.
image


How to fix it?

You’re not supposed to do it that way and now you suffer the consequences.
I suppose you could try an export/import, but that’s just speculation from my side.

Also, that’s a mighty wide VDEV you have there, even at RAIDZ3…

not import/export, just replace disk without web gui.

I’m wondering if it logs the mapping of the disk and zpool somewhere else if I use WEB GUI. When I use zpool replace, it will not record it.

Where can I add it back?

This should be an easy fix given you have a RAIDZ3.
Read the User Guide on how to replace a drive first. When you are able to remove the suspect drive, ensure you wipe it of partitions. Then you should be able to add it back to the pool using the GUI.

Worst case: Backup your data, destroy the pool, recreate the pool, copy your data back. I don’t think you need to do that however.

Someone with more experience on drive replacements should be able to assist.

What I’m trying to do is write a script to run zpool replace automatically after I replaced the broken drive

It checks the physical location of the disk, if it belongs to a pool before, and the serial number changes, it will run zpool replace PoolName OLD_GPTID NEW_GPTID

But I coudn’t find it for TrurNAS CORE 13.3.
So I use zpool replace directly and trying to do the GUI dones(like create partitation, assign to the pool) at the script.

And the zpool itself works fine, just missing the mapping of the disk and the pool in the GUI.
Doing the rebuild again just for the mapping at GUI, I think it’s not worth for it.

Is there something like database or config file I can edit to create the mapping at GUI?

Why not just use the GUI?

3 Likes