0

I am trying to automatically mount a CIFS share on a Synology NAS during boot time. I am on a 14.04 LTS Workstation.

Everything works fine when I manually mount the share using the fstab entry, however, I have to repeat this step every time I am logged in.

I installed the cifs-utils and amended the fstab as follows:

//192.168.0.xxx/share /Volumes/share cifs iocharset=utf8,credentials=/var/xxx/.smb 0 0 

.smb contains the username= and passwd= settings, different locations were tried.

The entry seems to work as I can either use mount -a or mount /Volumes/share to successfully mount the share.

Any ideas, why the automount during boot fails? So far I've tried various solutions including the _netdev option, which does however seem to break the entry.

TIA for your answers.

  • It could possibly be failing because the network isn't up by the time the cifs mount is attempted. You could try putting a script with mount /Volumes/share in an executable script in /etc/network/if-up.d so that it mounts after the network goes up. – zhongfu Apr 12 '15 at 1:25
  • just tried it, unfortunately no difference, the share is still not mounted upon boot – Styrofoam Apr 12 '15 at 2:08
  • 1
    Hmm, this might help then. As a bonus, you can set it to only mount when connected to certain networks. – zhongfu Apr 12 '15 at 2:24
1

thanks zhongfu, this was the path to the solution.

I had to change the arch-script to this to work:

#!/bin/bash
if [ "$2" = "up" ]
   then
    mount /Volumes/share &
fi

location of the script:

/etc/NetworkManager/dispatcher.d/

Owner: root, mode 755

Now it works like a charm :-)

BTW: it could be related to my system booting off an SSD, the network actually is started after the login prompt is displayed

thanks again :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.