[SOLVED] Unable to export ZFS pool: pool busy

wrobelda

Member
Apr 13, 2022
58
4
13
Hi there,

I am migrating my PBS4 + PVE9 server to a new disk array. I moved all datasets to new pool and now am trying to take the old pool offline. However, no matter what I do, that pool is somehow still in use:
Code:
root@proxmox:~# zpool export -f pool1
cannot export 'pool1': pool is busy
, despite:
  1. zfs list -H -o name -t volume -r pool1 returning nothing
  2. datacenters migrated
  3. /etc having no trace of pool1 outside of /etc/zfs/zpool.cache
  4. /pool1, the root mountmount, not even existing
  5. zfs list -o name,mountpoint,mounted | grep pool1showing datasets unmounted
    1. as such, checking with fuser/lsof makes no sense, no files can actually be opened
  6. pool being ONLINE, not reslivering/scrubbing.
What else am I missing?

I tried exporting in single mode, but they aren't even imported at that point, so something in multiuser init brings that pool back online.

EDIT: Upon inspecting the journal, I see
Code:
Aug 18 18:46:25 proxmox zed[8523]: eid=8 class=pool_import pool='pool1'
Aug 18 18:46:25 proxmox zed[8524]: eid=7 class=config_sync pool='pool1'
Aug 18 18:46:27 proxmox systemd[1]: Finished zfs-import-cache.service - Import ZFS pools by cache file.
Aug 18 18:46:27 proxmox systemd[1]: Starting zfs-mount.service - Mount ZFS filesystems...
Aug 18 18:46:27 proxmox systemd[1]: Starting zfs-volume-wait.service - Wait for ZFS Volume (zvol) links in /dev...
Aug 18 18:46:27 proxmox zfs[8683]: cannot mount 'pool1': mountpoint or dataset is busy
Aug 18 18:48:18 proxmox systemd[1]: pool1.mount: Deactivated successfully.

EDIT: OK, grep pool1 /proc/*/mounts | cut -d/ -f3 | uniq | xargs ps showed a virtiofsd process that continued to look at /pool1. Coincidentally, a mere ps aux did, too...

EDIT: There's a minor bug involved here, though: removing a host mapping from Directory Mapping does *not* stop the corresponding virtiofsd deamon, so it continues running. Reported to Bugzilla: https://bugzilla.proxmox.com/show_bug.cgi?id=6699
 
Last edited:
  • Like
Reactions: UdoB