LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   mounting network samba drive using cifs in /etc/rc.local file (https://www.linuxquestions.org/questions/linux-server-73/mounting-network-samba-drive-using-cifs-in-etc-rc-local-file-753162/)

rioguia 09-06-2009 06:24 PM

mounting network samba drive using cifs in /etc/rc.local file
 
I have a samba server (CENTOS 5.3). The server has a share called "export_name." For the purpose of this question, the share has no password.

I want to mount "export_name" automatically when I boot on a client (UBUNTU 9.4). The mountpoint is called "/home/my_local_user_name/export_name."

I have added this single line to the /etc/rc.local file on the UBUNTU client, saved it, and set the executable bit (chmod + /etc/rc.local). The line is as follows:

mount -o username=user //192.xxx.xxx.xxx/export_name /home/my_local_user_name/export_name

This rc.local file does not work on boot but works only when I open a terminal and type:
sudo sh /etc/rc.local

crabboy 09-06-2009 09:45 PM

Why not add it to you /etc/fstab file?

Code:

//remoteserver/share /mnt/share smbfs auto,credentials=/root/.smbcredentials,uid=user,gid=user,fmask=0777,dmask=0777 0 0

rioguia 09-09-2009 08:22 PM

Thanks for your reply.

SMBFS has been depreciated and is no longer included in Ubuntu. If smbfs is necessary, you have to compile it from source, or use a version of Ubuntu earlier than Hardy (not recommended).


All times are GMT -5. The time now is 01:50 AM.