Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
However, instead of putting the username and password in this file which is readable by everyone you might do better putting them in a root only readable file, for example /root/.cifs.conf. This file would contain:
and you would use the following line in your /etc/fstab
@JJJCR: If you are able to run mount /home/backup/Email without any errors then the fstab entry itself is good. The mount command used from the command line doesn't have all the options that are needed, so the system will look in the fstab file and use what's there to complete the mount command.
Maybe the fstab order in which things are mounted isn't correct. / (and possibly /home) should be mounted before you try to mount the cifs mount.
Actually, the reason i want to reboot the server because I want to check whether the mounting will be done automatically.
Are you aware of mount's -a option?
mount -a will mount those entries that aren't mounted and do not have the noauto flag. Any new (or unmounted) entry in the fstab file can be mounted this way. However, mount -a doesn't look at the order of the entries.
The above won't replace a reboot, but it will give you a very good indication if the individual(!!) entries are processed correctly.
Originally Posted by JJJCR
I did some Googling, would this be right to put on rc.local?
sleep 70 && mount //192.168.1.17/Email /home/backup/Email cifs &
I'm not sure about the sleep part. rc.local is executed after all the rcX.d stuff is done. Maybe you need to wait a bit for things to settle down, maybe not. Experiment if at all possible.
A simpler mount command would do: mount /home/backup/Email &
I do assume that the cifs entry is present in your fstab file (and, as mentioned by you in post #6, mounting from the command line works).
If the cifs entry isn't present in fstab then you need the full blown mount command to be in rc.local, something like this:
mount -t cifs -o username=admin,password=xxx111 //192.168.1.17/Email /home/backup/Email &
Beware: rc.local is readable by normal users so I would go with evo2's suggestion and store the password and user in a root owned file (say /root/.cifs.conf) and use that instead for security reasons. This command would look like this:
mount -t cifs -o credentials=/root/.cifs.conf //192.168.1.17/Email /home/backup/Email &
Last edited by druuna; 09-20-2013 at 08:08 AM.
Reason: Fixed typo.
Just read your last post,,
didn't realise something might be down ( the NAS )
You could have the @reboot cronjob test if the nas is available and mount,
If not send a WOL to it, sleep a little and test and hopefully mount
have it in an until loop
( until it succeeds or fails too many times )