cimryan / teslausb

Steps and scripts for turning a Raspberry Pi into a useful USB drive for a Tesla

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Read-only root filesystem prevents Samba daemon from working after reboot

ScrawnyB opened this issue · comments

I am trying a slightly more complex setup on top of your scripts that involves the addition of the Samba daemon to share the file system (cam, music, and reshare my CIFS-mounted archive) so I can update music and pull dashcam files using my Android phone and a tool like Root Explorer that can browse SMB. This works during the initial install of samba when the filesystem is mounted as root, but as soon as a reboot happens - it breaks and the daemon never starts again until you remount the root FS as R/W and reinstall and/or restart the Samba daemon.

Here are relevant messages of the service failing to start after a reboot.

root@teslacam-m3:~# sudo systemctl start smbd.service
Job for smbd.service failed because the control process exited with error code.
See "systemctl status smbd.service" and "journalctl -xe" for details.

root@teslacam-m3:~# systemctl status nmbd.service
● nmbd.service - Samba NMB Daemon
Loaded: loaded (/lib/systemd/system/nmbd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2019-01-18 22:25:52 EST; 6s ago
Docs: man:nmbd(8)
man:samba(7)
man:smb.conf(5)
Process: 5667 ExecStart=/usr/sbin/nmbd $NMBDOPTIONS (code=exited, status=1/FAILURE)
Main PID: 5667 (code=exited, status=1/FAILURE)

Jan 18 22:25:51 teslacam-m3 systemd[1]: Starting Samba NMB Daemon...
Jan 18 22:25:52 teslacam-m3 systemd[1]: nmbd.service: Main process exited, code=exited, status=1/FAILURE
Jan 18 22:25:52 teslacam-m3 systemd[1]: Failed to start Samba NMB Daemon.
Jan 18 22:25:52 teslacam-m3 systemd[1]: nmbd.service: Unit entered failed state.
Jan 18 22:25:52 teslacam-m3 systemd[1]: nmbd.service: Failed with result 'exit-code'.

Nov 03 13:17:03 teslacam-m3 systemd[1]: Starting Samba NMB Daemon...
Nov 03 13:17:08 teslacam-m3 nmbd[395]: mkdir failed on directory /var/log/samba/cores: No such file or directory
Nov 03 13:17:08 teslacam-m3 nmbd[395]: Failed to create /var/log/samba/cores for user 0 with mode 0700
Nov 03 13:17:08 teslacam-m3 nmbd[395]: Unable to setup corepath for nmbd: No such file or directory
Nov 03 13:17:08 teslacam-m3 nmbd[395]: [2016/11/03 13:17:08.194376, 0] ../lib/util/debug.c:951(reopen_logs_internal)
Nov 03 13:17:08 teslacam-m3 nmbd[395]: Unable to open new log file '/var/log/samba/log.': No such file or directory
Nov 03 13:17:08 teslacam-m3 systemd[1]: nmbd.service: Main process exited, code=exited, status=1/FAILURE
Nov 03 13:17:08 teslacam-m3 systemd[1]: Failed to start Samba NMB Daemon.
Nov 03 13:17:08 teslacam-m3 systemd[1]: nmbd.service: Unit entered failed state.
Nov 03 13:17:08 teslacam-m3 systemd[1]: nmbd.service: Failed with result 'exit-code'.

Reinstalling the Samba daemon while root FS is mounted as R/W, and also editing /etc/fstab to mount /root as RW fixes this issue, but most likely has other side effects or consequences if the Model 3 still has issues with disconnecting the USB device.