LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 02-07-2007, 12:16 PM   #1
emg
Member
 
Registered: Apr 2005
Location: Western Mass USA
Distribution: Sabayon 4.2K 64bit
Posts: 107

Rep: Reputation: 15
how do I mount a smb share at boot


Hi Everyone,

I'd like to mount a smb share from a windows machine when my suse10.2 laptop boots ... I tried adding a line to my fstab but because I use wireless to connect to my lan and fstab is read before wlan0 is up ... it doesn't mount the share ... If I run mount -a from a root-terminal the share would mount fine so I know the line I had in fstab was good...So I figured a script to mount the share would work if it was the last one before kde loads, that way wlan0 is up and connected...but I don't know what to put in the script or where to put the script so it can be ran. I tried a script like:

#! bin/sh
mount -t cifs 192.168.2.07/MP3s /home/myuserid/music


and I put this in /ect/init.d

that didn't work so I moved the script to /ect/rc5.d so it would load when I go into runlevel 5 but this also didn't work ... I also tried it with the script in both places ... still didn't work ...So now I'm posting here .... I don't know if the little script I wrote is wrong or if I put it in the wrong place or both... Any help or ideas would be great .... Thanks

Erick
 
Old 02-07-2007, 12:26 PM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
You can put it in /etc/rc.local or look at /etc/init.d/rc.local to see what it does (on my machine it calls /etc/rc.local) in case you don't have this file.

mount -t cifs 192.168.2.07/MP3s /home/myuserid/music
Does this command works from a shell?

I would
1) put this in /etc/fstab
//srv/share /home/myuserid/music cifs noauto,user=DOMAIN\user,iocharset=utf8,uid=<xxx>,gid=<xxx> 1 2

2) put this in /etc/rc.local:
mount /home/myuserid/music
 
Old 02-07-2007, 06:11 PM   #3
emg
Member
 
Registered: Apr 2005
Location: Western Mass USA
Distribution: Sabayon 4.2K 64bit
Posts: 107

Original Poster
Rep: Reputation: 15
ok I'm getting closer ... I put the following in fstab:

//192.168.2.07/MP3s /home/myuserid/music cifs rw,noauto,user 0 0

then I edited /ect/init.d/smb

which is the script that loads/starts the smb daemon and I added


mount -t cifs //192.168.2.07/MP3s /home/myuserid/music

in the start loop and I put the umount command in the stop loop

now when I boot I get to a spot that asks for the root password ... then goes on and loads kde ... if I then do a ctrl-alt-f1 I see that its still waiting for the password I enter it then alt-f7 to get back to the gui it works .... when I try the command

mount -t cifs //192.168.2.07/MP3s /home/myuserid/music

from a ROOT terminal it still asks for root's password ... if I could get past the password stuff I should be all set ....
 
Old 02-07-2007, 09:38 PM   #4
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
create a credentials file with username and password in it, chmod 600 for security, and you are set.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't mount a smb share over wireless... Savet Linux - Wireless Networking 10 05-02-2011 01:14 PM
NFS mount of smb mount of windows share: permission denied problem :( Bagatur Linux - Networking 4 07-07-2009 11:34 AM
Trying to mount a SMB share in C++ Calestar Programming 1 01-15-2006 11:58 PM
can't mount smb share as non-root user nixinbarrie Linux - Networking 5 09-27-2004 08:51 PM
Cannot mount SMB share hotblack Linux - Networking 7 08-07-2003 11:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration