SFARRES's picture

I have add a CIFS mount in the Webmin module: Systems | Disk and Network Filesystem and ticked Save and mount at boot. I then checked the /etc/fstab file for the entry and its there, however the share is not mounting upon bootup as expected from the fstab entry, as far as I can see the other items in fstab load just fine at boot.

Here's what does work:

1) The share mounts if I select mount from the entry Systems | Disk and Network Filesystem through Webmin once the machien has started up fully

2) Once booted the share mounts by running: mount -a

So I'm pretty certain that the syntax in fstab is correct. Could it be that fstab is trying to mount the share before the network is ready on bootup? How can I reorder / pause the CIFS line of fstab? Should I put a

Here's the entry in fstab edited:

//serverIP/sharename    /mnt/mountpoint    cifs    workgroup=DOMAIN_NAME,password=PASSWORD,uid=0,gid=0,username=USERNAME    0    0

Any thoughts?

This is a Moodle appliance from Turnkey

Forum: 
Tags: 
Jeremy Davis's picture

I recall reading about this being an issue. From my understanding it can happen if the networking is a little slow to kick in, so when fstab tries to mount the share it isn't available (because network is not yet up) so fstab gives up and moves on to other entries...

I vaguely recall reading a workaround somewhere but sorry can't give you any pointers. If you keep in mind that TKL v12.x is based on Debian perhaps you can find smoething via google?

OTTOMH you should be able to test that your fstab entry is valid by running

mount -a

And if that works then I strongly suspect that it's as I mentioned above... If it still doesn't work perhaps double check that the mount command above is correct (I think it is but didn't double check). If that's right then there may be something wrong with your fstab entry...?

PS if you do end up working this out, be great if you could post back as no doubt others may run into a similar issue. Thanks

Art Igweike's picture

Basically do the followings on the smb client

 

1:  chkconfig netfs on

2:  service netfs  start

For example if the smb server hostname is  hello.example.com  and the share name  is share

3:  On the smb client  touch a file for example  /etc/mysmbpass chmod 755 /etc/mysmbpass

4: On the smb client   vim  /etc/fstab add the following to the fstab

5:  On the smb client     cd /  then create a mount point   mkdir -p   /mysmb for example and if you want read and write access do the follow below if read only then replace the rw woth ro.

 

See how the /etc/mysmbpass  should look like

vim /etc/mysmbpass

username=bob (In this case my user name is bob)

password=bob123 (In this case my password is bob123)

 

6:  vim  /etc/fstab

//hello.example.com      /mysmb    -rw,_netdev,credentials=/etc/mysmbpass     0 0

 

save file

7: Test your new entry

8: mount -a

9:  run     df command to make sure it mounts with no errors

10: reboot   your smb client server to make sure the samba file system mounts on reboot.

 

Looking above in the fstab I added   _netdev   this is to tell the system to mount the remote smb mount even after the smb client network services are fully activated.

 

Art Igweike's picture

Sorry I missed out the share it self for example if the share name is texas

 

The fstab should have the following entry

6:  vim  /etc/fstab

//hello.example.com/texas     /mysmb    -rw,_netdev,credentials=/etc/mysmbpass     0 0

nico's picture

In Debian Wheezy asyncmountnfs is the cause. Is Ubuntu using the same scripts?: http://lifeisabug.com/fix-debian-wheezy-mounting-cifs-smb-shares-boot-time/

Jeremy Davis's picture

Thanks for posting. TKL is now based on Debian (as of v12.x - based on Debian Squeeze; current TKL is v13.0 based on Debian Wheezy) so your advice is spot on and totally relevant! :)

Yanet Sanchez's picture

Mount password protected network folders

            1. create a file for your remote servers logon credential: gedit ~/.smbcredentials
                1.1 Enter your Windows username and password in the file: 
                    username=user
                    password=*******
                1.2 Change the permissions of the file to prevent unwanted access to your credentials: 
                    chmod 600 ~/.smbcredentials

            2. The quickest way to auto-mounting a password-protected share is to edit /etc/fstab (with root privileges), to add this line: 

                   //servername/sharename /media/windowsshare cifs iocharset=utf8,credentials=/home/ubuntuusername/smbcredentials,gid=1234, 0  0 

 

            3. Test the fstab entry by issuing: 

                mount -a

Add new comment