VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: automating cifs [solved]  (Read 1694 times)

JJSH

  • Member
  • *
  • Posts: 27
automating cifs [solved]
« on: January 09, 2008, 12:07:28 pm »

I am mounting network shares from my NAS box using the following from a terminal;

mount -t cifs //nas-ip-address/sharename  /home/jjsh/mnt/sharename -o user=jjsh,password=mypassword


I need to SU to do this, and there are a number of shares that I mount, that then appear in the mnt directory of my home.

Where can I put this so that this is automated during boot?


TIA

JJSH
« Last Edit: January 09, 2008, 03:04:16 pm by nightflier »
Logged

newt

  • Vectorian
  • ****
  • Posts: 1132
Re: automating cifs
« Reply #1 on: January 09, 2008, 12:12:29 pm »

edit:
I think '/etc/fstab' would be the best place.
see nightfliers post below (still learning over here :D)
« Last Edit: January 09, 2008, 12:51:23 pm by newtor »
Logged

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4083
Re: automating cifs
« Reply #2 on: January 09, 2008, 12:41:59 pm »

What I have found, is that /etc/fstab is processed before cifs/smbfs is loaded, and therefore fail to mount network shares.

I have had better luck using /etc/rc.d/rc.local  It is run with root privileges. You can add your commands to that file.
Logged

JJSH

  • Member
  • *
  • Posts: 27
Re: automating cifs
« Reply #3 on: January 09, 2008, 02:39:50 pm »

Cheers Nightflier. Can I just add the same line that I type into the terminal?


Update: Yes, yes I can! All sorted. Thanks for the help, you can mark this thread solved  ;D
« Last Edit: January 09, 2008, 02:46:38 pm by JJSH »
Logged

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4083
Re: automating cifs [solved]
« Reply #4 on: January 09, 2008, 03:05:24 pm »

Done. Happy to be of help.   :)
Logged