From:
sudo ls -al /dev/disk/by-id
... one gets the proper drive designator to use. It's a combination of the manufacturer and the serial number... almost guaranteed to be a unique set of characters.
One then adds the drive to the pool thusly, using the proper designator:
sudo zpool add rpool cache usb-USB_SanDisk_3.2Gen1_040191ba36b4278c904c8e14fbcd88246946ab2e0b32e810102d37fedccd5e584aa800000000000000000000fe160dd1ff938218815581074e2c9df1-0:0-part1
I attempted to remove the L2ARC cache drive from the rpool after I'd discovered it was corrupted:
sudo zpool remove rpool cache usb-USB_SanDisk_3.2Gen1_040191ba36b4278c904c8e14fbcd88246946ab2e0b32e810102d37fedccd5e584aa800000000000000000000fe160dd1ff938218815581074e2c9df1-0:0-part1
cannot remove cache: no such device in pool
cannot remove usb-USB_SanDisk_3.2Gen1_040191ba36b4278c904c8e14fbcd88246946ab2e0b32e810102d37fedccd5e584aa800000000000000000000fe160dd1ff938218815581074e2c9df1-0:0-part1: no such device in pool
That means ZFS is getting the path and device node of the drive from the proper designator, then replacing the proper designator with the path and device node... so on the next reboot with a change in drive path and node assignment (which is going to happen with external USB drives being plugged and unplugged, even if your zpool drives are not unplugged), the pool is corrupted.
It shouldn't do that. It should continue to look at the designator, sym-linking that to find the device path and node, no matter how that device path and node changes.
pool: rpool
state: ONLINE
status: One or more devices could not be used because the label is missing or
invalid. Sufficient replicas exist for the pool to continue
functioning in a degraded state.
action: Replace the device using 'zpool replace'.
see: ZFS Message ID: ZFS-8000-4J
scan: scrub repaired 0B in 0 days 00:04:13 with 0 errors on Sat Dec 3 19:04:17 2022
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
5f52e75c-505f-9941-a9c4-da071f9836f0 ONLINE 0 0 0
cache
pool: rpool
state: ONLINE
status: One or more devices could not be used because the label is missing or
invalid. Sufficient replicas exist for the pool to continue
functioning in a degraded state.
action: Replace the device using 'zpool replace'.
see: ZFS Message ID: ZFS-8000-4J
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
5f52e75c-505f-9941-a9c4-da071f9836f0 ONLINE 0 0 0
cache
pool: rpool
state: ONLINE
status: One or more devices could not be used because the label is missing or
invalid. Sufficient replicas exist for the pool to continue
functioning in a degraded state.
action: Replace the device using 'zpool replace'.
see: ZFS Message ID: ZFS-8000-4J
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
5f52e75c-505f-9941-a9c4-da071f9836f0 ONLINE 0 0 0
cache
sdc1 FAULTED 0 0 0 corrupted data
But here's the thing... if I attempt to remove sdc1 from the rpool, it says:
sudo zpool remove rpool cache sdc1
cannot remove cache: no such device in pool
But after attempting to remove it by the proper designator and by the device path and node, it does indeed get removed, despite zpool's protestations.
I then add it back in and SCRUB it, whereupon I get a healthy report:
sudo zpool status
pool: bpool
state: ONLINE
scan: scrub repaired 0B in 0 days 00:00:06 with 0 errors on Sat Dec 3 19:32:08 2022
config:
NAME STATE READ WRITE CKSUM
bpool ONLINE 0 0 0
c0714ccb-bc6f-5a4c-80bd-46777d248b07 ONLINE 0 0 0
cache
usb-USB_SanDisk_3.2Gen1_040109ab39a31603e14cf811677fa184acc1d2f9da793b38870d29dd2ded3103020300000000000000000000bc9cab2500826a188155810768ad7a27-0:0-part1 ONLINE 0 0 0
errors: No known data errors
pool: rpool
state: ONLINE
scan: scrub repaired 0B in 0 days 00:02:30 with 0 errors on Sat Dec 3 19:34:37 2022
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
5f52e75c-505f-9941-a9c4-da071f9836f0 ONLINE 0 0 0
cache
usb-USB_SanDisk_3.2Gen1_040191ba36b4278c904c8e14fbcd88246946ab2e0b32e810102d37fedccd5e584aa800000000000000000000fe160dd1ff938218815581074e2c9df1-0:0-part1 ONLINE 0 0 0
errors: No known data errors
So there's a code glitch in zpool.