Couldn't export my main pool: pool is busy message but it's not even mounted!?

SOLVED: If you are using jlmkr, disable the jlmkr.py script and reboot then do the export and it works flawlessly. otherwise you will not be able to export the pool that jlmkr is using.

I want to export my main pool (called main).

The export told me everything that was busy so I used lsof and fuser to identify the users. But now I am totally stuck and even zpool export -f main fails due to a busy message.

When I try the GUI to export, the UI says this:
image
but docker isn’t running so I’m baffled. I do run jlmkr so I wonder if it is that docker, but I’m not seeing anything in the ps.

root@truenas[~]# lsof |grep /main
root@truenas[~]# lsof |grep mnt/main
root@truenas[~]# lsof |grep mnt/
root@truenas[~]# lsof |grep SSD
root@truenas[~]# lsof |grep '/main'
root@truenas[~]# fuser -m /mnt/main
Specified filename /mnt/main does not exist.
root@truenas[~]# ls /mnt
SSD
root@truenas[~]# zpool export -f main
cannot export 'main': pool is busy
root@truenas[~]# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
root@truenas[~]#                                           

As shown in the picture you posted, the pool is linked to Docker. So the resulting question is: did you stop all Docker containers before trying to export the pool, or are they still running?

I figured it out. I did a zpool export after a reboot and it complained about:
cannot unmount '/mnt/main/jailmaker/jails/docker': pool or dataset is busy

So it was not the main docker which was killed, but the jailed docker which didn’t appear in a ps, I’m guessing because of systemd-nspawn:

root@truenas[~]# fuser -m /mnt/main/jailmaker/jails/docker
/mnt/main/jailmaker/jails/docker:  5938c  6216rce  7221rce  7601rce  7838rce  7853rce  7856rce  7860rce  7862rce 10101rce 10659rce 14578rce 14590rce 15144re 15164m 15353m 15974m 16049m 17298m
root@truenas[~]# ps 5938
    PID TTY      STAT   TIME COMMAND
   5938 ?        Ss     0:00 /usr/bin/systemd-nspawn --keep-unit --quiet --boot --bind-ro=/sys/module --inaccessible=/sy
root@truenas[~]# ps -ww 5938
    PID TTY      STAT   TIME COMMAND
   5938 ?        Ss     0:00 /usr/bin/systemd-nspawn --keep-unit --quiet --boot --bind-ro=/sys/module --inaccessible=/sys/module/apparmor --machine=docker --directory=rootfs --network-bridge=br0 --resolv-conf=bind-host --system-call-filter=add_key keyctl bpf --bind=/mnt/main/docker/data:/mnt/data --bind=/mnt/main/docker/stacks:/opt/stacks --bind=/mnt/main:/mnt/main # so can pass any dataset to a container
root@truenas[~]#

Disabling the jailmkr startup script allowed Export to work no problem.

1 Like