Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
When I place it in the rc.local file and execute the rc.local file it works with no issues and mounts the drive fine. However If I save the output to a file and reboot the server I get the following error message, and it doesn't mount:
Log of /bin/mount -t cifs //<IP ADDRESS>/<DIRECTORY> --verbose -o user=USER,pa
ss=PASSWORD,dom=DOM /mnt/ntserver
Thu Mar 19 12:48:02 2009
mount.cifs kernel mount options unc=//<IP ADDRESS>\<DIRECTORY>,ip=<IP ADDRESS>,v
er=1,rw,user=USER,pass=PASSWORD,dom=DOM
mount error 113 = No route to host
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
/bin/mount died with exit status 255
The route to host message is normally displayed when no network card is present or functioning - but I thought rc.local was the last thing to run?
Have you tried mounting it using /etc/fstab? You can use a credentials file to hide the username and password from prying eyes (by keeping it in /root, for example):
Have you tried mounting it using /etc/fstab? You can use a credentials file to hide the username and password from prying eyes (by keeping it in /root, for example):
The username and password are stored in the credentials file (/root/smb.pass in my example). Any other options are before or after the credentials option:
In essence, the 5th and 6th ones you don't need to worry about and can leave as 0 and 0 respectively. Take a look at man mount.cifs on the specific options you can include and their syntax. Also see man 5 fstab for the syntax of /etc/fstab.
Also, I just realised why your first attempt may have failed; the correct syntax for specifying the domain is domain=DOMAIN, NOT dom=DOMAIN.
Are there any new error messages in /var/log/messages about it trying to mount during boot? What if you type mount -a as root? Any errors there? Are you sure you need the domain switch (with mine, I found it worked without it whereas it didn't with...)?
Also, do a chmod go-rw /root/smb.pass so that only root can see the username and password you're using to connect to the samba share.
So it's not working because it doesn't recognise smbfs as a valid filesystem, yet you can successfully mount it from the command line? Try changing smbfs to cifs as they're synonymous.
So it's not working because it doesn't recognise smbfs as a valid filesystem, yet you can successfully mount it from the command line? Try changing smbfs to cifs as they're synonymous.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.