Samba server not working in RW mode

  • Platform information:
    • Hardware: RPI4
    • OS: Openhabian3
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version:
  • Issue of the topic: Samba server not working in RW mode from Windows

Hello,
My Samba on OH3 has strange behaviour. I can see all the shares:

but if I open the folder in Windows Explorer, I can rename the files, but I can’t rewrite the contents.
I try to map the server as network drive with option to connect with different credentials. User is openhabian, password is the one I set up on
sudo smbpasswd openhabian

image

If I enter the password for openhabian/samba (they are same), I get the Network Error message:

image

some info from command line:

openhabian@openHABianDevice:~ $ smbd --version
Version 4.9.5-Debian
openhabian@openHABianDevice:~ $ systemctl status smbd.service
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2021-02-02 00:05:02 CET; 1 weeks 2 days ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 17622 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
 Main PID: 1174 (smbd)
   Status: "smbd: ready to serve connections..."
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/smbd.service
           β”œβ”€1174 /usr/sbin/smbd --foreground --no-process-group
           β”œβ”€1234 /usr/sbin/smbd --foreground --no-process-group
           β”œβ”€1235 /usr/sbin/smbd --foreground --no-process-group
           └─1240 /usr/sbin/smbd --foreground --no-process-group

feb 11 12:21:39 openHABianDevice systemd[1]: Reloading Samba SMB Daemon.
feb 11 12:21:39 openHABianDevice systemd[1]: smbd.service: Can't open PID file /run/smbd.pid (yet?) after reload: No such fil
feb 11 12:21:39 openHABianDevice systemd[1]: Reloaded Samba SMB Daemon.
feb 11 12:22:17 openHABianDevice smbd[16426]: pam_unix(samba:session): session closed for user openhabian
feb 11 12:22:56 openHABianDevice systemd[1]: Reloading Samba SMB Daemon.
feb 11 12:22:56 openHABianDevice systemd[1]: smbd.service: Can't open PID file /run/smbd.pid (yet?) after reload: No such fil
feb 11 12:22:56 openHABianDevice systemd[1]: Reloaded Samba SMB Daemon.
feb 11 12:25:42 openHABianDevice systemd[1]: Reloading Samba SMB Daemon.
feb 11 12:25:42 openHABianDevice systemd[1]: smbd.service: Can't open PID file /run/smbd.pid (yet?) after reload: No such fil
feb 11 12:25:42 openHABianDevice systemd[1]: Reloaded Samba SMB Daemon.

Where should I start? it looks that samba has something not configured properly?

thank you,
Michal, Slovakia

Reinstall Samba from the openHABian menu.
If that does not work, try systemctl stop openhab zram-config.service, then reinstall Samba then reboot.

1 Like

Thanks,
first one does not work, I have stucked on

openhabian@openHABianDevice:~ $ systemctl stop openhab zram-config.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to stop 'openhab.service'.
Authenticating as: ,,, (openhabian)
Password:
==== AUTHENTICATION COMPLETE ===
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to stop 'zram-config.service'.
Authenticating as: ,,, (openhabian)
Password:
==== AUTHENTICATION COMPLETE ===

No command line prompt appeared after, so I have pressed Ctrl-C and continued.
EDIT: Waited, command prompt appeared, repeated the steps, but with the same result.

it takes time to sync to disk. You must not interrupt that!

Sorry, so I wait, repeated the steps, but nothing has been changed, still no RW access

still this:

openhabian@openHABianDevice:~ $ systemctl status smbd.service
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-02-11 13:01:12 CET; 5min ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 1071 ExecStartPre=/usr/share/samba/update-apparmor-samba-profile (code=exited, status=0/SUCCESS)
  Process: 1939 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
 Main PID: 1082 (smbd)
   Status: "smbd: ready to serve connections..."
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/smbd.service
           β”œβ”€1082 /usr/sbin/smbd --foreground --no-process-group
           β”œβ”€1205 /usr/sbin/smbd --foreground --no-process-group
           β”œβ”€1206 /usr/sbin/smbd --foreground --no-process-group
           └─1219 /usr/sbin/smbd --foreground --no-process-group

feb 11 13:01:11 openHABianDevice systemd[1]: Starting Samba SMB Daemon...
feb 11 13:01:12 openHABianDevice systemd[1]: Started Samba SMB Daemon.
feb 11 13:05:46 openHABianDevice systemd[1]: Reloading Samba SMB Daemon.
feb 11 13:05:46 openHABianDevice systemd[1]: smbd.service: Can't open PID file /run/smbd.pid (yet?) after reload: No such fil
feb 11 13:05:46 openHABianDevice systemd[1]: Reloaded Samba SMB Daemon.

Someone an idea where to start?
EDIT:
The problem was, I was trying to connect \\192.168.1.32\ instead of \\192.168.1.32\openHAB-conf. Probably the reinstall process and this has helped me to be able to rewrite the files.