# DietPi v8.9.2 updated with Samba issues?

**URL:** https://dietpi.com/forum/t/dietpi-v8-9-2-updated-with-samba-issues/14605
**Category:** General Discussion
**Created:** [14 October 2022 05:44 UTC](https://dietpi.com/forum/t/dietpi-v8-9-2-updated-with-samba-issues/14605 "2022-10-14T05:44:40Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![qlander](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/q/ba8739/32.png) [@qlander](https://dietpi.com/forum/u/qlander)
#### Post date: [14 October 2022 05:44 UTC](https://dietpi.com/forum/t/dietpi-v8-9-2-updated-with-samba-issues/14605/1 "2022-10-14T05:44:40Z")

</div>

Just updated to DietPi v8.9.2, however it seemed to wipe out access to Samba shares.

Local SD and usb drives not remotely accessible - local access works fine (fstab/drivemanager all ok)

/etc/samba/smb.conf as follows:

```auto
[global]

        workgroup = WORKGROUP
        server string = %h server
        dns proxy = no
        log file = /var/log/samba/log.%m
        max log size = 1000
        syslog only = no
        syslog = 0

        panic action = /usr/share/samba/panic-action %d

        security = user
        encrypt passwords = true
        passdb backend = tdbsam
        obey pam restrictions = yes
        unix password sync = yes

        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        pam password change = yes
        map to guest = bad user

        load printers = no
        printcap name = /dev/null
        disable spoolss = yes

[dietpi_data]
        comment = DietPi Share
        path = /mnt/dietpi_userdata
        browseable = yes
        create mask = 0664
        directory mask = 0775
        valid users = dietpi
        writeable = yes
        max connections = 8
        case sensitive = auto

[dietpi]
        comment = DietPi Share
        path = /home/dietpi
        browseable = yes
        create mask = 0664
        directory mask = 0775
        #valid users = dietpi
        writeable = yes
        max connections = 8
        case sensitive = auto

[usb1]
        comment=Local HD (SSD)
        path=/mnt/usb1
        browseable=yes
        writeable=yes
        create mask=0777
        directory mask=0777
        only guest=no
        guest ok=no
        public=no
        #valid users = "diepi"
        max connections = 8
        case sensitive = auto

```

Not accessible from Windows (10) and \*nix os’s. Was working fine before the upgrade and before rebooting clients - on client reboot, samba share to the dietpi is deined…using \ip\ prompts for u/p and then fails, even with root.

Even chaging to below doesn’t work:

```auto
valid users = diepi
force users = dietpi

```

```auto
: sudo pdbedit -w -L | awk -F: '{print $1}'
dietpi

```

```auto
: samba-tool user list
ltdb: tdb(/var/lib/samba/private/sam.ldb): tdb_open_ex: could not open file var/lib/samba/private/sam.ldb: No such file or directory

Unable to open tdb '/var/lib/samba/private/sam.ldb': No such file or directory
Failed to connect to 'tdb:///var/lib/samba/private/sam.ldb' with backend 'tdb': Unable to open tdb '/var/lib/samba/private/sam.ldb': No such file or directory

```

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [14 October 2022 07:12 UTC](https://dietpi.com/forum/t/dietpi-v8-9-2-updated-with-samba-issues/14605/2 "2022-10-14T07:12:11Z")

</div>

> [@qlander](#):
>
> `samba-tool user list`

Our SAMBA configuration is taking the users from os layer. Therefore `samba-tool user list` is not working as it is not configured this way. As a default value, we set `valid users = dietpi`. This will allow access using dietpi user only (with os password). You could try to adjust the password as follow:

```auto
smbpasswd -a dietpi

```

As well can you share following

```auto
journalctl -u nmbd -u smbd
systemctl status nmbd smbd
ss -tulpn | grep LISTEN

```

---

<div class="post-metadata">

### Author: ![qlander](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/q/ba8739/32.png) [@qlander](https://dietpi.com/forum/u/qlander)
#### Post date: [14 October 2022 07:59 UTC](https://dietpi.com/forum/t/dietpi-v8-9-2-updated-with-samba-issues/14605/3 "2022-10-14T07:59:24Z")

</div>

Same issue when resetting smb password using ‘smbpasswd -a dietpi’. What’s strange is root doesn’t even work ☹

```auto
root@:~# journalctl -u nmbd -u smbd
-- Logs begin at XXX 2019-02-XX XX:XX:XX XXXX, end at XXX 2022-10-XX XX:XX:XX XXX. --
Oct XX XX:XX:XX XXXXXXXX systemd[1]: /lib/systemd/system/nmbd.service:9: PIDFile= references path below legacy directory /var/run/, updating /var/run/samba/nmbd.pid → /run/samba/nmbd.pid; please update the unit file accordingly.
Oct XX XX:XX:XX XXXXXXXX systemd[1]: Starting Samba NMB Daemon...
Oct XX XX:XX:XX XXXXXXXX systemd[1]: Started Samba NMB Daemon.
Oct XX XX:XX:XX XXXXXXXX systemd[1]: /lib/systemd/system/smbd.service:9: PIDFile= references path below legacy directory /var/run/, updating /var/run/samba/smbd.pid → /run/samba/smbd.pid; please update the unit file accordingly.
Oct XX XX:XX:XX XXXXXXXX systemd[1]: Starting Samba SMB Daemon...
Oct XX XX:XX:XX XXXXXXXX systemd[1]: Started Samba SMB Daemon.
Oct XX XX:XX:XX XXXXXXXX smbd[4801]: pam_unix(samba:session): session opened for user dietpi by (uid=0)
Oct XX XX:XX:XX XXXXXXXX smbd[4801]: pam_unix(samba:session): session closed for user dietpi
Oct XX XX:XX:XX XXXXXXXX smbd[6991]: pam_unix(samba:session): session opened for user dietpi by (uid=0)
Oct XX XX:XX:XX XXXXXXXX smbd[6991]: pam_unix(samba:session): session closed for user dietpi

```

```auto
root@:~# ***systemctl status nmbd smbd***
● nmbd.service - Samba NMB Daemon
   Loaded: loaded (/lib/systemd/system/nmbd.service; disabled; vendor preset: enabled)
   Active: active (running) since XXX 2022-10-XX XXX:XX:XX XXXX; XXX
     Docs: man:nmbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 582 (nmbd)
   Status: "nmbd: ready to serve connections..."
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/nmbd.service
           └─582 /usr/sbin/nmbd --foreground --no-process-group

Oct XX XX:XX:XX XXXXXXXX systemd[1]: Starting Samba NMB Daemon...
Oct XX XX:XX:XX XXXXXXXX systemd[1]: Started Samba NMB Daemon.

● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; disabled; vendor preset: enabled)
   Active: active (running) since XXX 2022-10-XX XX:XX:XX XXXX; XXX
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 606 ExecStartPre=/usr/share/samba/update-apparmor-samba-profile (code=exited, status=0/SUCCESS)
 Main PID: 607 (smbd)
   Status: "smbd: ready to serve connections..."
    Tasks: 3 (limit: 4915)
   CGroup: /system.slice/smbd.service
           ├─607 /usr/sbin/smbd --foreground --no-process-group
           ├─610 /usr/sbin/smbd --foreground --no-process-group
           └─611 /usr/sbin/smbd --foreground --no-process-group

Oct XX XX:XX:XX XXXXXXXX systemd[1]: Starting Samba SMB Daemon...
Oct XX XX:XX:XX XXXXXXXX systemd[1]: Started Samba SMB Daemon.
Oct XX XX:XX:XX XXXXXXXX smbd[4801]: pam_unix(samba:session): session opened for user dietpi by (uid=0)
Oct XX XX:XX:XX XXXXXXXX smbd[4801]: pam_unix(samba:session): session closed for user dietpi
Oct XX XX:XX:XX XXXXXXXX smbd[6991]: pam_unix(samba:session): session opened for user dietpi by (uid=0)
Oct XX XX:XX:XX XXXXXXXX smbd[6991]: pam_unix(samba:session): session closed for user dietpi

```

```auto
root@:~# ***ss -tulpn | grep LISTEN***
tcp LISTEN 0 128 0.0.0.0:8081 0.0.0.0:* users:(("python",pid=275,fd=4))                    
tcp LISTEN 0 256 0.0.0.0:53 0.0.0.0:* users:(("unbound",pid=563,fd=4))                   
tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=553,fd=3))                      
tcp LISTEN 0 5 0.0.0.0:8888 0.0.0.0:* users:(("rpimonitord",pid=1372,fd=5))              
tcp LISTEN 0 4096 127.0.0.1:8125 0.0.0.0:* users:(("netdata",pid=909,fd=11))                  
tcp LISTEN 0 50 0.0.0.0:445 0.0.0.0:* users:(("smbd",pid=607,fd=31))                     
tcp LISTEN 0 4096 0.0.0.0:19999 0.0.0.0:* users:(("netdata",pid=909,fd=3))                   
tcp LISTEN 0 128 0.0.0.0:8421 0.0.0.0:* users:(("pisugar-server",pid=269,fd=13))           
tcp LISTEN 0 1024 0.0.0.0:8422 0.0.0.0:* users:(("pisugar-server",pid=269,fd=11))           
tcp LISTEN 0 1024 0.0.0.0:8423 0.0.0.0:* users:(("pisugar-server",pid=269,fd=10))           
tcp LISTEN 0 4096 0.0.0.0:5001 0.0.0.0:* users:(("iperf",pid=1606,fd=3))                    
tcp LISTEN 0 80 127.0.0.1:3306 0.0.0.0:* users:(("mysqld",pid=671,fd=23))                   
tcp LISTEN 0 50 0.0.0.0:139 0.0.0.0:* users:(("smbd",pid=607,fd=32))                     
tcp LISTEN 0 128 0.0.0.0:10000 0.0.0.0:* users:(("miniserv.pl",pid=1593,fd=5))              
tcp LISTEN 0 511 0.0.0.0:80 0.0.0.0:* users:(("nginx",pid=780,fd=5),("nginx",pid=779,fd=5),("nginx",pid=778,fd=5),("nginx",pid=777,fd=5),("nginx",pid=776,fd=5))
tcp LISTEN 0 4096 *:5201 *:* users:(("iperf3",pid=1604,fd=3))                   
tcp LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=553,fd=4))                      
tcp LISTEN 0 2 [::ffff:127.0.0.1]:3350 *:* users:(("xrdp-sesman",pid=537,fd=7))               
tcp LISTEN 0 2 *:3389 *:* users:(("xrdp",pid=554,fd=11))                     
tcp LISTEN 0 50 [::]:445 [::]:* users:(("smbd",pid=607,fd=29))                     
tcp LISTEN 0 50 [::]:139 [::]:* users:(("smbd",pid=607,fd=30))                     
tcp LISTEN 0 511 [::]:80 [::]:* users:(("nginx",pid=780,fd=6),("nginx",pid=779,fd=6),("nginx",pid=778,fd=6),("nginx",pid=777,fd=6),("nginx",pid=776,fd=6))

```

---

<div class="post-metadata">

### Author: ![qlander](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/q/ba8739/32.png) [@qlander](https://dietpi.com/forum/u/qlander)
#### Post date: [14 October 2022 08:19 UTC](https://dietpi.com/forum/t/dietpi-v8-9-2-updated-with-samba-issues/14605/4 "2022-10-14T08:19:05Z")

</div>

This is strange. I reinstalled smb server and added usb1 to the smb.config (as above) and now the /mnt/dietpi\_userdata and /home/dietpi are accessible, but /mnt/usb1 still isn’t from WIndows 10, another RPi and a Ubuntu OS). However usb1 is accessible via andriod mobile phone Cx File Explorer.

> drwxrwxr-x 13 dietpi dietpi 4096 Oct XX XX:XX dietpi\_userdata  
> drwxrwxrwx 1 dietpi dietpi 4096 May XX XX:XX usb1

usb1 was mounted using dietpi-drive\_manager before the latest update and accessible locallly

> UUID=XXXXXXXXXXXXXX /mnt/usb1 ntfs noatime,lazytime,rw,permissions,big\_writes,nofail,noauto,x-systemd.automount

Could it be possibly related to SMB Version? (I have V1 enabled in Windows 10, but disabling it makes no difference)

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [14 October 2022 08:28 UTC](https://dietpi.com/forum/t/dietpi-v8-9-2-updated-with-samba-issues/14605/5 "2022-10-14T08:28:36Z")

</div>

what exactly is the error message on Windows while trying to access usb1 share

**EDIT**

on the 2nd Pi, did you tried to mount the USB1 share manually?

```auto
sudo mount -t cifs -o username=dietpi,password=<share_password> //SHARE_IP/usb1 /mnt/samba

```

---

<div class="post-metadata">

### Author: ![qlander](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/q/ba8739/32.png) [@qlander](https://dietpi.com/forum/u/qlander)
#### Post date: [14 October 2022 08:56 UTC](https://dietpi.com/forum/t/dietpi-v8-9-2-updated-with-samba-issues/14605/6 "2022-10-14T08:56:45Z")

</div>

I can access when its shared as “public = yes” (and removing any user reference), but when enabling “valid users = diepi” it fails.

I get the following (Windows 10)

1. Explorer: \ip\usb1\
2. "Enter Network Credentials, Enter your crediendials to connect to: , dietpi, ,…etc…
3. Error: Open Folder \\usb1 is not accessible. You might not have permissions to use this network resource. Contact the administrator…etc…"

I’ve even removed Windows Credentials for it in Credentials Manager and even tried using \\dietpi as the username…still no access

EDIT: The mobile phone accessing it is via SFTP - so nvm about that…

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [14 October 2022 09:11 UTC](https://dietpi.com/forum/t/dietpi-v8-9-2-updated-with-samba-issues/14605/7 "2022-10-14T09:11:04Z")

</div>

Did you tried to mount manually from the other Pi as described above?

can you share your configuration again

```auto
ls -la /mnt/
cat /etc/fstab
cat /etc/samba/smb.conf
df -h
lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid

```

I would like to replicate your environment if possible.

---

<div class="post-metadata">

### Author: ![qlander](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/q/ba8739/32.png) [@qlander](https://dietpi.com/forum/u/qlander)
#### Post date: [14 October 2022 09:13 UTC](https://dietpi.com/forum/t/dietpi-v8-9-2-updated-with-samba-issues/14605/8 "2022-10-14T09:13:46Z")

</div>

Shouldn’t I use dietpi-drive\_manager to mount it?

Edit: using dietpi-drive\_manager to reinstall the drive on another DietPi seemed to work. Just Windows still doesn’t work

> _ **/etc/fstab** _  
> //IP/usb1 /mnt/RemotePi cifs cred=/var/lib/dietpi/dietpi-drive\_manager/mnt-RemotePi.cred,iocharset=utf8,uid=dietpi,gid=dietpi,file\_mode=0770,dir\_mode=0770,vers=3.1.1,nofail,noauto,x-systemd.automount

---

<div class="post-metadata">

### Author: ![qlander](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/q/ba8739/32.png) [@qlander](https://dietpi.com/forum/u/qlander)
#### Post date: [14 October 2022 09:41 UTC](https://dietpi.com/forum/t/dietpi-v8-9-2-updated-with-samba-issues/14605/9 "2022-10-14T09:41:05Z")

</div>

Fixed it - seems there was a bug with Windows 10 - I uninstalled SMB V1.0…

I just copied a working entry from another RPI (dietpi) for the usb1 share and pasted it into the ‘broken’ one to ensure I had a working entry for the drive as follows:

> cat /etc/samba/smb.conf  
> …  
> [usb1]  
> comment = Local Storage Drive  
> path = /mnt/usb1  
> browseable = yes  
> writeable = yes  
> create mask = 0777  
> directoy mask = 0777  
> only guest = no  
> guest ok = no  
> public = no  
> read only = no  
> valid users = dietpi  
> force user = dietpi  
> force group = dietpi  
> case sensitive = auto

I then had to re-mount on the other \*nix machines (copied from the dietpi-drive manager to ensure they were standard mounts (as per dietpi v8.9.2 dietpi-drive\_mount), so had this on remotes as:

> //IP/usb1 /mnt/PiName cifs username=dietpi,password=XXXXXXXXX,iocharset=utf8,uid=localuid,gid=localgid,file\_mode=0770,dir\_mode=0770,vers=3.1.1,nofail,noauto,x-systemd.automount

Whats really strange is that I didn’t even touch the Ubuntu mount entry, yet it _ **now** _ decided to work:

> //IP/usb1 /mnt/Pi37 cifs user,rw,\_netdev,credentials=/XXXXX/CREDENTIALSFILE,comment=systemd.automount,exec,uid=admin,gid=admin 0 0

And now Windows access also works…very weird intermittent behaviour

@Joulinar thanks for your quick assistance 🙂 I’m not sure what happened nor what really fixed it.
