TrueNas SMB broken after trobleshooting - empty passdb, password changes fail with Errno2

Hi,

after a restart of my Truenas Scale 25.04 (following a VM IP change) I had mount issues (mounting my Dataset on /mnt/mnt/Datapool instead of /mnt/Datapool), which i could resolve.
However I’m failing to get my SMB running, the SMB connections established before no longer work and reject every password. Also changing a user password results in “Errno 2: no such file or directory”. So far I tried:

  • SMB Service is active (running), ready to serve connections
  • “midclt call smb.passdb_list” returns: []
  • “ls -l /var/db/system/samba4/private” exists, but does not contain a “passdb.tdb”, but e.g. secrets.tdb is there.
  • “mount | grep system” shows “AppPool/.system on /var/db/system” (My SMB Shares are on on my HDD “DataPool”, while the OS and Apps is on my SSD “AppPool”).

I tried to restart SMB & Middleware. I checked ACL (but it worked before so I dont think this is the problem). Midclt call smb.reset and midclt call smb.synchronize_passdb did not work.

During my troulbeshooting i ultimately did the following, hoping that restarting smb afterwards would correctly recreate a working setup:

rm -rf /var/db/samba/*
rm -rf /var/run/samba-cache/*

How can i restore my SMB safely. I am new to Truenas and have some files on DataPool which I want to keep safe. I am running out of ideas and would be very very gratefull for your help! Thanks a lot :slight_smile:

PS: ChatGPT recommended to change my system DatasetPool (system –> advanced settings –> storage) from my AppPool to my DataPool. Since I dont want to break things any further and I dont know whether this is safe to do, i did not follow up on this.

Please provide more details on your VM setup. In particular, are you passing an HBA through, or are you passing disks directly through to your VM?

As a clarification: So The VM ran before and is not involved in the smb part, it was only the reason for me to restart the system. I have accessible over br0. Does that answer the question?

I’m confused. Is your installation running as a VM, or did the VM you mention exist within TrueNAS?

Ok i could finally fix it myself! Should you ever have this issue, this is what helped me. After verifying that the files were actually missing and not just wrongly pathed i did:

mkdir -p /run/samba-cache/private
chmod 700 /run/samba-cache/private
midclt call smb.synchronize_passdb

check: midclt call smb.passdb_list

midclt call service.restart cifs

I hope this solution is persistent and does not occur again after a reboot.

Thanks to this great community!

As posted already i fortunately was able to solve my issue on my on.

Just for clarification: I was talking about a VM that was running on my TrueNas system. So it was not part of the issue. The VM was only the reason for me to reboot my truenas system, that this vm was running on.