0

Media server running Ubuntu 16.04 and Kodi. Synology NAS in the next room contains all the media.

how can I get my fstab mounts working if they won't mount on bootup? -- tried switching to username/password instead of .smbcredentials, no change.

Tried adding _netdev, no change.

I've tried fixing my /etc/fstab and it's just not working. I'm not sure what the problem is, but I cannot get my NAS folders to mount that way. Posted here, posted on ubuntuforums, no go (didn't get any answers in either one). Every time I reboot I have to ssh in to the box to get my media folders back.

So, I thought I'd take a different approach. I'm assuming there is some issue with my NAS or network that makes mounting at boot via fstab to not work. I don't know.

Since I know that my folders will mount with sudo mount -a, how can I run that command at boot time after everything else (network especially) is done?

1

One way to add your command at startup would be to add it as a cron job.

Add your command to the root cron by typing in the following line in a terminal window:

sudo crontab -e

then at the bottom of the cron add a line that reads like this:

@reboot /bin/mount -a

or if you want to add a delay of like 10 seconds to it:

@reboot /bin/bash -c 'sleep 10 && /bin/mount -a'

that should tell it to run the mount -a command as root at boot up time.

Or, you could add it to your system wide crontab by editing the following file:

/etc/crontab

and adding the following line:

@reboot root /bin/bash -c 'sleep 10 && /bin/mount -a'

Hope this helps!

  • askubuntu.com/questions/335615/… -- had to add "root" before /bin/bash. Still doesn't work though. They mount fine with sudo mount but @reboot root /bin/bash -c 'sleep 10 && /sbin/mount -a' doesn't do anything. Is it the /sbin that's the problem? I got an error with /bin – jcollum Jul 7 '16 at 2:11
  • Oh wait it worked but using sudo crontab -e seems to open the wrong crontab. I did sudo vi crontab and it worked – jcollum Jul 7 '16 at 2:25
  • @jcollum That is interesting, but glad you got it working. =) – Terrance Jul 7 '16 at 2:27
  • @jcollum I am going to add that to my answer here. – Terrance Jul 7 '16 at 2:32
0

Maybe it's trying to mount your share before the network is ready.

In this case, you should add _netdev option in your /etc/fstab.

Example :

//server/share /mountpoint  cifs username=xx,password=yy,_netdev 0 0

This forces the OS to wait for the network to be ready before trying to mount this mountpoint.

  • _netdev - sorry, I forgot to mention that I tried that. – jcollum Jul 1 '16 at 12:58

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.