Cannot import zfs pool after moving disks to another machine

Hello,

Is it possible to get around this on IncusOS.

❯ incus admin os system storage import-storage-pool bar: -d '{"name":"foo","type":"zfs","encryption_key":"REDACTED"}'
WARNING: The IncusOS API and configuration is subject to change

Error: Failed to run: zpool import foo: exit status 1 (cannot import 'foo': pool was previously in use from another system.
Last accessed by bar (hostid=blah) at Sun Aug  9 07:24:01 2026
The pool can be imported, use 'zpool import -f' to import the pool.)

Gracias!

Yes, add the -f flag, just as the message suggests..

I think the question is, how do you get incus admin os system storage import-storage-pool to pass the -f flag to zpool import?

% incus admin os system storage import-storage-pool --help
Description
  Import an existing encrypted storage pool

Usage:
  incus admin os system storage import-storage-pool [<remote>:] [flags]

Flags:
  -d, --data     Command data
      --target   Cluster member name

Global Flags:
      --debug          Show all debug messages
      --explain        If the command is valid, explain its parsed arguments instead of running it
      --force-local    Force using the local unix socket
  -h, --help           Print help
      --project        Override the source project
  -q, --quiet          Don't show progress information
      --sub-commands   Use with help or --help to view sub-commands
  -v, --verbose        Show all information messages
      --version        Print version number

You’re right. Before you do incus admin os ..., you have to run this command to import all pools on the new system:

sudo zpool import -f -a

Or for one specific pool:

sudo zpool import -f <pool_name>

If the pool was encrypted, you also need to import keys:

zfs load-key -a

And if you want the pool to be mounted to the old location, run:

zfs mount -a

Edit: I missed the fact that it’s about IncusOS :face_with_peeking_eye:

I think you miss the point. IncusOS doesn’t have a shell - by design.

Until we tweak incus-os to pass -f (Support force import of existing storage pools by hangrymuppet · Pull Request #1425 · lxc/incus-os · GitHub), your best bet would be to attach to another system, then import + export. That way the pool should show as properly exported and can be imported cleanly.