Unable to add VDEV to existing pool - VDEV refer to same device

Hi all,

Today I had 2 drives fail in my pool because the NVMe connector seemed to be overheating. The NVMe bay now has active cooling and after a fresh install of TrueNAS with a config restore I am unable to add a CACHE VDEV to my existing pool.

Trying this I get the following error:
[EFAULT] [EZFS_BADDEV] cannot add to 'hddPOOL': one or more vdevs refer to the same device

Error code
 Error: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 515, in run
    await self.future
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 560, in __run_body
    rv = await self.method(*args)
         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/service/crud_service.py", line 287, in nf
    rv = await func(*args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 48, in nf
    res = await f(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 174, in nf
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/pool_/pool.py", line 769, in do_update
    raise CallError(extend_job.error)
middlewared.service_exception.CallError: [EFAULT] [EZFS_BADDEV] cannot add to 'pool': one or more vdevs refer to the same device

I wiped the drive and I also changed the physical port it was seated in. There was no change.

sudo zpool status -v

Output
  pool: boot-pool
 state: ONLINE
config:

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

errors: No known data errors

  pool: POOL
 state: ONLINE
  scan: resilvered 0B in 00:00:00 with 0 errors on Mon Aug 18 18:58:03 2025
config:

        NAME                                      STATE     READ WRITE CKSUM
        POOL                                   ONLINE       0     0     0
          raidz1-0                                ONLINE       0     0     0
            50bc85b4-100d-4ba4-9e9c-50e7c2dd31d3  ONLINE       0     0     0
            5f3fd91e-cb7b-48a3-9b9b-474782123a7f  ONLINE       0     0     0
            965966e8-f7fd-4c4e-bb5d-f7cde632068b  ONLINE       0     0     0
        logs
          mirror-1                                ONLINE       0     0     0
            2321475e-267d-4896-9410-c0b5c2f8a7ea  ONLINE       0     0     0
            888c1dba-eae1-4390-814a-16abceaa382f  ONLINE       0     0     0

errors: No known data errors

  pool: POOL
 state: ONLINE
  scan: resilvered 3.47G in 00:00:03 with 0 errors on Mon Aug 18 12:35:49 2025
config:

        NAME                                      STATE     READ WRITE CKSUM
        POOL                                   ONLINE       0     0     0
          mirror-0                                ONLINE       0     0     0
            e45ce975-7c45-40a0-909a-84182c73a117  ONLINE       0     0     0
            bcfe0ad4-76ca-44d7-97df-cc566d2d6186  ONLINE       0     0     0

errors: No known data errors

If I use the following command:
sudo zpool add pool cache nvmeX
I did get the cache VDEV configured but the UI would still show a drive available:

Does anyone have the solution? Thanks.

Reinstalling and restoring my configuration did not help in this case. It’s still showing the same errors unfortunately.

Drives are:
3 x Ultrastar HDDs
2 x Intel Optane NVMe
3 x Samsung 990 Pro NVMe

Where are the experts hiding? :smiley:

I doubt I am the first one to have this issue, any help would be appreciated.

No one?

There is not enough information for me to assist.

For example, the error message includes pool name of “hddPOOL”, except that the zpool status output does not show a pool with that name. I understand that may be a typo, as there is a pool named “POOL”.

Please supply the output of the following commands:

zpool status -L
lsblk

Last, TrueNAS is not intended to be used separately from it’s user interface. Some actions taken in standard Unix Shell will not be recognized by the GUI / TUI. Adding a L2ARC / Cache device is one example that won’t work. An export / import of the pool through the GUI / TUI would cause it to recognize the change. Or a simple reboot.

Output:

zpool status -L
  pool: boot-pool
 state: ONLINE
config:

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

errors: No known data errors

  pool: hddPOOL
 state: ONLINE
config:

        NAME           STATE     READ WRITE CKSUM
        hddPOOL        ONLINE       0     0     0
          raidz1-0     ONLINE       0     0     0
            sdb1       ONLINE       0     0     0
            sdc1       ONLINE       0     0     0
            sdd1       ONLINE       0     0     0
        logs
          mirror-1     ONLINE       0     0     0
            nvme0n1p1  ONLINE       0     0     0
            nvme3n1p1  ONLINE       0     0     0

errors: No known data errors

  pool: ssdPOOL
 state: ONLINE
  scan: resilvered 3.47G in 00:00:03 with 0 errors on Mon Aug 18 12:35:49 2025
config:

        NAME           STATE     READ WRITE CKSUM
        ssdPOOL        ONLINE       0     0     0
          mirror-0     ONLINE       0     0     0
            nvme4n1p1  ONLINE       0     0     0
            nvme1n1p1  ONLINE       0     0     0

errors: No known data errors
lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0    48G  0 disk 
├─sda1        8:1    0     1M  0 part 
├─sda2        8:2    0   512M  0 part 
└─sda3        8:3    0  47.5G  0 part 
sdb           8:16   0  21.8T  0 disk 
└─sdb1        8:17   0  21.8T  0 part 
sdc           8:32   0  21.8T  0 disk 
└─sdc1        8:33   0  21.8T  0 part 
sdd           8:48   0  21.8T  0 disk 
└─sdd1        8:49   0  21.8T  0 part 
sr0          11:0    1   1.9G  0 rom  
zd0         230:0    0   128G  0 disk 
nvme4n1     259:0    0   3.6T  0 disk 
└─nvme4n1p1 259:2    0   3.6T  0 part 
nvme1n1     259:1    0   3.6T  0 disk 
└─nvme1n1p1 259:3    0   3.6T  0 part 
nvme2n1     259:4    0   3.6T  0 disk 
nvme3n1     259:6    0 110.3G  0 disk 
└─nvme3n1p1 259:7    0 109.2G  0 part 
nvme0n1     259:8    0 110.3G  0 disk 
└─nvme0n1p1 259:9    0 109.2G  0 part 

If you checked my second post you would see that I reinstalled TrueNAS after that with the config I used prior of when the problems started.

Output of the zpool status -L does not show any L2ARC / Cache device. So I am assuming during your re-install that was not added.

Your copy / paste of the lsblk was another paste of zpool status -L.

As for the other comment, it is just a reminder to all, (forum threads can be searched and read years in the future…).

The cache was a part of the pool but I cannot restore that because of the error message I get in the first post.

I edited the lsblk output in my previous post, the shift-insert/ctrl-insert c/p from shell takes time to get used to.

Okay, it appears that nvme2n1 is not in use, and probably the device you wanted to use for L2ARC / Cache. However, it is not partitioned the way the others are.

If you used the whole device from the command line like you showed:

sudo zpool add pool cache nvme2n1

That may have confused the middleware software, causing the GUI to show the device still available. So that could explain the error.

Since it is possible their is left over junk on nvme2n1, you may need to wipe the 2 disk labels / partition tables, (even if their are no partitions). Then possibly reboot to make sure the middleware notices the changes. Afterwards, attempt to add the device as a L2ARC / Cache again.

As for how to wipe the 2 disk labels, it has been a long time since I have had to do such. A quick google search says this is how:

wipefs -a /dev/nvme2n1

Make sure you have the right device and you feel comfortable doing the task. (Caveat emptor…)

1 Like

The wipefs command worked but I still get this error trying to add the drive as a cache through the UI:

Did you reboot after the wipefs -a?

Yes I did.

lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 48G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 512M 0 part
└─sda3 8:3 0 47.5G 0 part
sdb 8:16 0 21.8T 0 disk
└─sdb1 8:17 0 21.8T 0 part
sdc 8:32 0 21.8T 0 disk
└─sdc1 8:33 0 21.8T 0 part
sdd 8:48 0 21.8T 0 disk
└─sdd1 8:49 0 21.8T 0 part
sr0 11:0 1 1.9G 0 rom
zd0 230:0 0 128G 0 disk
nvme2n1 259:0 0 3.6T 0 disk
└─nvme2n1p1 259:2 0 3.6T 0 part
nvme1n1 259:1 0 3.6T 0 disk
└─nvme1n1p1 259:3 0 3.6T 0 part
nvme3n1 259:4 0 3.6T 0 disk
└─nvme3n1p1 259:5 0 3.6T 0 part
nvme0n1 259:6 0 110.3G 0 disk
└─nvme0n1p1 259:7 0 109.2G 0 part
nvme4n1 259:8 0 110.3G 0 disk
└─nvme4n1p1 259:9 0 109.2G 0 part

I am going to start from scratch. Thank you for your help Arwen.

Sorry I could not help.