[SOLVED] Deleting pool and getting "[EFAULT] cannot unmount '/var/db/system/samba4': pool or dataset is busy" error

Hi all,

I have a test deployment of TrueNAS Scale (Dragonfish-24.04.2.3) running on a computer with a few drives connected. I’m trying to wipe my pool/dataset and start fresh but when trying to remove it using Storage > Export/Disconnect, I get the error in the title and this log:

"""
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/plugins/zfs_/pool.py", line 87, in do_delete
    with libzfs.ZFS() as zfs:
  File "libzfs.pyx", line 529, in libzfs.ZFS.__exit__
  File "/usr/lib/python3/dist-packages/middlewared/plugins/zfs_/pool.py", line 88, in do_delete
    zfs.destroy(name, force=options['force'])
  File "libzfs.pyx", line 1598, in libzfs.ZFS.destroy
libzfs.ZFSException: cannot unmount '/var/db/system/samba4': pool or dataset is busy

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/concurrent/futures/process.py", line 256, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/worker.py", line 112, in main_worker
    res = MIDDLEWARE._run(*call_args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/worker.py", line 46, in _run
    return self._call(name, serviceobj, methodobj, args, job=job)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/worker.py", line 34, in _call
    with Client(f'ws+unix://{MIDDLEWARE_RUN_DIR}/middlewared-internal.sock', py_exceptions=True) as c:
  File "/usr/lib/python3/dist-packages/middlewared/worker.py", line 40, in _call
    return methodobj(*params)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 53, in nf
    res = f(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 191, in nf
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/zfs_/pool.py", line 93, in do_delete
    raise CallError(str(e), errno_)
middlewared.service_exception.CallError: [EFAULT] cannot unmount '/var/db/system/samba4': pool or dataset is busy
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 469, in run
    await self.future
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 511, in __run_body
    rv = await self.method(*args)
         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 187, in nf
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 47, in nf
    res = await f(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/pool_/export.py", line 145, in export
    await self.middleware.call('zfs.pool.delete', pool['name'])
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1564, in call
    return await self._call(
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1417, in _call
    return await methodobj(*prepared_call.args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/service/crud_service.py", line 199, in delete
    return await self.middleware._call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1425, in _call
    return await self._call_worker(name, *prepared_call.args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1431, in _call_worker
    return await self.run_in_proc(main_worker, name, args, job)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1337, in run_in_proc
    return await self.run_in_executor(self.__procpool, method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1321, in run_in_executor
    return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
middlewared.service_exception.CallError: [EFAULT] cannot unmount '/var/db/system/samba4': pool or dataset is busy```
type or paste code here

I have the SMB service turned off and no docker containers or anything running. What is hanging this up?

Restarted the system and tried again, and got this message:

Error: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 469, in run
    await self.future
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 511, in __run_body
    rv = await self.method(*args)
         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 187, in nf
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 47, in nf
    res = await f(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/pool_/export.py", line 138, in export
    await self.middleware.call_hook('pool.pre_export', pool=pool['name'], options=options, job=job)
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1290, in call_hook
    await fut
  File "/usr/lib/python3/dist-packages/middlewared/plugins/sysdataset.py", line 705, in pool_pre_export
    raise CallError(f'This pool contains system dataset, but its reconfiguration failed: {sysds_job.error}')
middlewared.service_exception.CallError: [EFAULT] This pool contains system dataset, but its reconfiguration failed: [EFAULT] Failed to rsync from /var/db/system: rsync: [sender] read errors mapping "/var/db/system/netdata-ae32c386e13840b2bf9c0083275e7941/dbengine/datafile-1-0000000062.ndf": Input/output error (5)
rsync: [sender] read errors mapping "/var/db/system/netdata-ae32c386e13840b2bf9c0083275e7941/dbengine/datafile-1-0000000062.ndf": Input/output error (5)
ERROR: netdata-ae32c386e13840b2bf9c0083275e7941/dbengine/datafile-1-0000000062.ndf failed verification -- update discarded.
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]

Where is your system dataset?
If its on the pool you are trying to delete - there may be your problem. Move it to another pool

I’m guessing it would be on the SSD under boot-pool, but where would I check that?

Hi @arcaeus , you can check here : System -> Advanced Settings -> Storage. Set boot-pool and Export/Disconnect next.

Great, thank you.

Yea it looks like the system dataset pool is on the boot-pool, which looks like it’s on the SSD based on the screenshot above.

And it’s works now ?

No, no change in issue.

Actually, yes that worked. My mistake was that as it showed that the “System Dataset Pool” was the boot-pool, I assumed that all the files were already included in that.

However when I re-read what you said, I realized that I needed to hit Configure and re-run the command. Once I did that, the pool was able to be deleted successfully.

Thank you!

1 Like