Jump to content

/etc/fstab vs sudo mount -a

Hello,

 

I recently installed installed a virtual ubuntu server (17.04) on top of Freenas 11 to host my personal website.  All of my html files are located on my Freenas and I was going to mount them in my ubuntu server in the same way I did on my laptop (also running ubuntu 17.04 but desktop version).

 

My /etc/fstab file has a line that is exactly like in my laptop that says

//192.168.0.5/Path/To/Files /home/username/WebDocs cifs credentials=/home/username/.smbcredentials 0 0

This server also has ufw installed with default deny but I allowed from app Samba to 192.168.0.5 and from 192.168.0.5 to app Samba.

 

Here is the kicker though, my WebDocs folder will not mount at boot, but as soon as I login I can type 'sudo mount -a' and it mounts in seconds, without making any changes to anything.

 

Why would 'sudo mount -a' work immediately but the files won't mount at boot?

 

//side note, I have a retropie that is having the same issue with mounted roms but does not have ufw installed.

Link to comment
Share on other sites

Link to post
Share on other sites

network is connecting after disks are mounted. There is a way to delay this, or have it done automatically when the network is up.

             ☼

ψ ︿_____︿_ψ_   

Link to comment
Share on other sites

Link to post
Share on other sites

On 9/10/2017 at 0:28 AM, SCHISCHKA said:

network is connecting after disks are mounted. There is a way to delay this, or have it done automatically when the network is up.

That makes a lot of sense.  My /etc/fstab now looks like this

//192.168.0.5/Path/To/Files /home/username/WebDocs cifs credentials=/home/username/.smbcredentials,uid=username,_netdev,x-systemd.automount 0 0

And it works!  The '_netdev' part is actually what fixed it, but I still needed the 'uid' part to set the permissions and the 'x-systemd.automount' makes it faster on boot...somehow...

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×