Skip to content

workshop remove giving zfs destroy error "dataset is busy" #1062

Open

Description

@benhoyt

I'm hitting the following error when running workshop remove (I haven't seen this issue before, and it went away after a reboot, but reporting in case others are seeing it too):

$ workshop remove
error: cannot perform the following tasks:
- Remove "dev" workshop (Error deleting storage volume: Failed running: \
  zfs destroy -r workshop/containers/workshop.10000_dev-0b407190: \
  exit status 1 (cannot destroy 'workshop/containers/workshop.10000_dev-0b407190': dataset is busy))

It looks similar to (but not the same as) #903.

I have not been using VMs.

To find the mount, I ran:

$ grep -H "workshop.10000_dev-0b407190" /proc/*/mounts 2>/dev/null
/proc/9555/mounts:workshop/containers/workshop.10000_dev-0b407190 /var/snap/lxd/common/lxd/storage-pools/workshop/containers/workshop.10000_dev-0b407190 zfs rw,relatime,xattr,posixacl,casesensitive 0 0

And PID 9555 is lxcfs:

$ ps aux | grep 9555
root        9555  0.0  0.0 454312   180 ?        Sl   Sep07   0:34 lxcfs /var/snap/lxd/common/var/lib/lxcfs -p /var/snap/lxd/common/lxcfs.pid

I tried restarting the lxd daemon (sudo systemctl restart snap.lxd.daemon) but workshop remove still fails with the same error after that. Then I tried a reboot and that "fixed" it.

Activity

  1. jonathan-conder commented on Sep 30, 2026

    @jonathan-conder
    Contributor

    Seems to be caused by canonical/lxd#18933, here's a reproducer:

    #!/bin/sh
    
    set -eu
    
    sudo snap install lxd --revision=40958
    sudo snap refresh --hold lxd
    lxd waitready
    lxd init --auto --storage-backend=zfs
    
    lxc launch images:alpine/3.22 c1
    
    sudo snap restart lxd
    lxd waitready
    lxc start c1 || true
    
    sudo snap refresh lxd --revision=40916
    lxd waitready
    
    for p in $(pgrep -x lxcfs); do
    	grep -q /var/snap/lxd /proc/$p/cmdline || continue
    	echo "lxcfs pid=$p ns=$(sudo readlink /proc/$p/ns/mnt) started=$(ps -o lstart= -p $p)"
    done
    p=$(< /var/snap/lxd/common/lxd.pid)
    echo "lxd   pid=$p ns=$(sudo readlink /proc/$p/ns/mnt)"
    
    lxc stop c1
    grep -H containers/c1 /proc/*/mounts
    lxc delete c1

    Output:

    lxd (5.21/stable) 5.21.8-3a06799 from Canonical✓ installed
    General refreshes of "lxd" held indefinitely
    Launching c1
    2026-09-30T00:09:01Z INFO Waiting for "snap.lxd.daemon.service" to stop.
    Restarted.
    Error: The instance is already running
    2026-09-30T00:09:17Z INFO Waiting for "snap.lxd.daemon.service" to stop.
    lxd 6.9-bf243da from Canonical✓ refreshed
    lxcfs pid=79776 ns=mnt:[4026532716] started=Wed Sep 30 00:09:09 2026
    lxcfs pid=81456 ns=mnt:[4026532717] started=Wed Sep 30 00:09:20 2026
    lxd   pid=81465 ns=mnt:[4026532717]
    /proc/79776/mounts:default/containers/c1 /var/snap/lxd/common/lxd/storage-pools/default/containers/c1 zfs rw,relatime,xattr,posixacl,casesensitive 0 0
    Error: Failed deleting instance "c1" in project "default": Error deleting storage volume: Failed running: zfs destroy -r default/containers/c1: exit status 1 (cannot destroy 'default/containers/c1': dataset is busy)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions