I passed through two devices to a VM running on proxmox and corrupted it.
If anyone else wants to virtualise TrueNAS using proxmox use these commands on the proxmox hypervisor first to prevent concurrent access on the device you are passing through:
(I started and switched to using the TrueNAS VM now, so different devices will show)
# zpool status -v
pool: boot-pool
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
boot-pool ONLINE 0 0 0
sdc3 ONLINE 0 0 0
errors: No known data errors
# zpool import
pool: datatank
id: 16911827047402167892
state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:
datatank ONLINE
mirror-0 ONLINE
sdb2 ONLINE
sda2 ONLINE
indirect-1 ONLINE
indirect-2 ONLINE
# zpool import datatank
cannot import 'datatank': pool was previously in use from another system.
Last accessed by proxmox (hostid=fc6c0867) at Tue Oct 7 22:31:24 2025
The pool can be imported, use 'zpool import -f' to import the pool.
# zpool import datatank -f
cannot import 'datatank': one or more devices is currently unavailable
Normally when I see a double-mounted pool it throws back the “insufficient replicas/corrupted data” rather than “one or more devices is currently unavailable” - I do see some indirect devices there as well, so did you ever do a vdev removal (ie: adding more disks including special vdevs, switching between a virtual and a passthrough disk, etc)? IIRC there was a brief point in time where “block clone exists + vdev removal happens” could cause problems.
Can I get the output of the last hundred or so lines /proc/spl/kstat/zfs/dbgmsg immediately after a failed import?
Yep, that would cause indirect devices. Hopefully this isn’t it.
spa_check_logs might be a better place to fail though - that means usually that the last uncommitted transaction group was corrupted (probably via the double-mount) and we might be able to rewind a little bit.
Try the import with -fF - both letters included, with case mattering here. f is “force import pool mounted by other host” and F is “force rewind”.
I remember getting this error while testing zfs and pool settings inside a VM. If I recall, I had created several virtual test disks in VMWare and put them into varying configurations within the virtualized TrueNAS. When I got the error it was because I had messed with one of the disk files outside of the VM on the host machine. Nothing I did would fix it. I even had backups of those test disks (should some issue occur) so I didn’t have to recreate them, but shutting down and copying over the backup disk did not fix it. I eventually had to start over and create new disks, new pools, etc.