Unit File Failure

After spending the whole of yesterday trying to get a samba share to work, I now need a bit of help, please.

I keep getting the following error:-

● data-smb-projects.mount - Projects - SMB share
     Loaded: loaded (/etc/systemd/system/data-smb-projects.mount; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Fri 2020-09-11 15:28:00 BST; 7s ago
      Where: /data/smb/projects
       What: //192.168.1.79/data/projects

systemd[1]: Mounting Projects - SMB share...
mount[32912]: mount error(2): No such file or directory
mount[32912]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
systemd[1]: data-smb-projects.mount: Mount process exited, code=exited, status=32/n/a
systemd[1]: data-smb-projects.mount: Failed with result 'exit-code'.
systemd[1]: Failed to mount Projects - SMB share.

Both paths exist and I can cd to them.

/data/projects is TriggeredBy: ● data-projects.automount

Unit File

Unit File location is /etc/systemd/system/data-smb-projects.mount

Unit File Contents

[Unit]
Description=Projects - SMB share
After=network.target

[Mount]
What=//$server/data/projects
Where=/data/smb/projects
Type=cifs
Options=_netdev,iocharset=utf8,rw,file_mode=0777,dir_mode=0777,user=$user,password=$password,workgroup=WORKGROUP
TimeoutSec=30

[Install]
WantedBy=multi-user.target

For $server I have used my hostname and also tried the ip address like this :-

What=//xxxx/data/projects
What=//192.168.1.79/data/projects

I have of course searched the forum and also battered my search engine into a cocked hat.

Thanks. :upside_down_face: :man_shrugging:

Make that:

After=network-online.target

See NetworkTarget

I disabled the unit ( just to be sure ) and then enabled the unit.

It Fails.

systemctl status … reports the same error :-

But thanks anyway :slight_smile: :+1:

Found this and it works, although I am confused about how different it is from the tutorials on mounting cifs devices.
I’m not sure if samba is the correct way to share files or if I should use nfs instead.
But I’ll go with this for now as a solution, and look at nfs as an alternative.
Gotta start somewhere.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.