Systemd no longer mounts smb [Solved]

  • I can no longer mount samba shares using systemd. I know the change to default cifs version is now 2.1, but I'm not sure that is my issue.

    I'm attempting to mount my share from an up to date freenas server. The issue I'm having is:

    Code
    systemctl start storage-ServerFolders-Videos.mount 
    A dependency job for storage-ServerFolders-Videos.mount failed. See 'journalctl -xe' for details.

    and

    journalctl -b 0 --no-pager:

    Code
    Jan 20 21:37:22 le-mx3 systemd[1]: Failed to mount cifs mount script.
    Jan 20 21:37:22 le-mx3 systemd[1]: Dependency failed for cifs mount script.
    Jan 20 21:37:22 le-mx3 systemd[1]: storage-ServerFolders-Videos.mount: Job storage-ServerFolders-Videos.mount/start failed with result 'dependency'.
    Jan 20 21:37:22 le-mx3 systemd[1]: storage-ServerFolders.mount: Unit entered failed state.

    I don't think the issue is smb protocol version because nmap shows that I've disabled smbv1 on the server:

    I've tried adding vers=2.10 to the options in the unit file but it still returns a dependency error. I am able to mount the same share via mount -t cifs -o username=user,password=passwd //freenas.local/Videos /storage/ServerFolders/Videos

    Anyone have any idea what else I can try to get theseshares to mount with systemd?

  • The unit file contains:

    I've tried with multiple values for vers and without vers altoghther. I always get the same error message: A dependency job for storage-ServerFolders-Videos.mount failed.

  • Your unit works as expected in official LE 8.2.2.

    What build are you using? Can you provide a complete "journalctl -a"? Maybe you have additional services that are now conflicting.

  • I have two systems, the first is a rpi3 which is running official LE 8.2.2 and the second is a amlogic S905X running kszaqs 8.2.2.3 build. Both systems are having the same error with identical unit files. Here is a pastbin link to the entire output of journalctl -a:

    External Content pastebin.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

    Code
    systemctl list-dependencies storage-ServerFolders-Videos.mount
    
    storage-ServerFolders-Videos.mount
    ● ├─network-online.service
    ● ├─storage-ServerFolders.mount
    ● ├─system.slice
    ● └─network-online.target
    ●   └─kodi-waitonnetwork.service

    I'm not sure how to interpret the output of systemctl list-dependencies storage-ServerFolders-Videos.mount.

  • Somehow your mount unit has a dependency on itself?

    From an RPi2 with LibreELEC 8.2.2 using your mount (only changes being the server ip address and share to match my own FreeNAS server, and vers=2.0 because my FreeNAS 8.3.x server only supports SMB2_00 not SMB2_10):

    Maybe try disabling and re-enabling the mount, and check you don't have any unexpected junk/sym links in /storage/.config/systemd.

  • There is a failing storage-ServerFolders.mount ( milhouse different unit name):

    Code: journalctl -a
    Dec 31 16:00:28 le-mx3 systemd[1]: storage-ServerFolders.mount: Directory /storage/ServerFolders to mount over is not empty, mounting anyway.
    Dec 31 16:00:28 le-mx3 systemd[1]: Mounting cifs mount script...
    Dec 31 16:00:28 le-mx3 connmand[3297]: eth0 {add} route 212.227.81.55 gw 192.168.1.1 scope 0 <UNIVERSE>
    Dec 31 16:00:28 le-mx3 kernel: FS-Cache: Netfs 'cifs' registered for caching
    Dec 31 16:00:29 le-mx3 connmand[3297]: ntp: adjust (jump): +96438127.610211 sec
    Jan 20 20:22:36 le-mx3 systemd[1]: Time has been changed
    Jan 20 20:22:36 le-mx3 connmand[3297]: eth0 {del} route 212.227.81.55 gw 192.168.1.1 scope 0 <UNIVERSE>
    Jan 20 20:22:37 le-mx3 connmand[3297]: ntp: adjust (slew): -0.006555 sec
    Jan 20 20:22:42 le-mx3 systemd[1]: storage-ServerFolders.mount: Mount process exited, code=exited status=255
    Jan 20 20:22:42 le-mx3 systemd[1]: Failed to mount cifs mount script.

    storage-ServerFolders-Videos.mount is getting an automatic dependency to storage-ServerFolders.mount and cannot started because of the failure.

    Assuming you do not need/want storage-ServerFolders.mount any more just disable or delete it.

  • storage-ServerFolders-Videos.mount is getting an automatic dependency to storage-ServerFolders.mount and cannot started because of the failure.

    Yes, this was it. That unit file was left over from a previous scheme I was using and is no longer used. It wasn't enabled, so I didn't realize systemd would create a dependency with it. I renamed it to a .bak extension, disabled the storage-ServerFolders-Videos.mount and reenabled it. Then it started working. Thanks for the help, I didn't know about that dependency command for systemctl.

    The head scratcher for me was that it was the same error on both systems, but it makes sense because I just copied the unit files from one to the other.