LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 06-27-2008, 12:26 AM   #1
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Rep: Reputation: 16
connect to samba shares on startup


i'm trying to mount my network shares on startup, however they do not connect. i have put a few lines into my /etc/rc.local file.. they look something like this:

mount -t smbfs //fileserver/1x300 /mnt/z -o username=administrator,password=password

i can copy that same line into a console, and run it as root, and everything connects the way it should. I would have put these commands into my /home/administrator/.kde/autostart, but mount does not want to work unless i'm root, and i suspected that everything in the autostart would try to start as my user.

is the rc.local file parsed before my network connection is active? the other mount commands in my rc.local file work, but they are for local drives not networked.
 
Old 06-27-2008, 12:50 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Why don't you put it your fstab? I'll post back a sample line later.
 
Old 06-27-2008, 01:09 AM   #3
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
i dont have it in my fstab because i like having all of my startup configurations all in one place. it makes it easier for me to make any changes. if putting it in my fstab is the only way to do it, then i can do it that way.

ive discovered another problem with the mount though. i do not have write access to the mount under my user, i only have write access as root. could this be because i am mounting the share as root? i tried to chown administrator /mnt/z as root, but i got an 'operation not permitted' message. im slapping the keyboard saying to my machine "but i'm ROOT!!!! you MUST permit it!!!"
 
Old 06-27-2008, 01:24 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Mounting volumes should be done properly, and that means fstab or one of the automount points

You should get teh permissions of the user you pass to Samba

ps - have you tried mounting as cifs rather than smbfs?
 
Old 06-27-2008, 04:48 PM   #5
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
I know about fstab, but what is "automount points"?

The username and password i'm passing to samba is the same username and password i use to log into Xwindows. I use the same username and password to log into all of my windows machines, and my linux desktop, so that I do not need to enter in a user/pass every time I want to connect to a share on a different machine.

I have not tried using cifs, I am not familiar with it.
 
Old 06-27-2008, 05:09 PM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Read man autofs to get some automounting info

Cifs is basically a replacement for smbfs, so I assume that makes it better. Here's a sample fstab entry

//server/home /home/user/mountpoint cifs username=username_here,password="password here",_netdev,uid=username_here,gid=group_name_here 0 0
 
Old 06-27-2008, 05:15 PM   #7
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
I'll just use fstab since i'm more familiar with that. Ive only used fstab to configure my local mounts before but it looks very similar.

I'll write a test entry for one of the mounts in my fstab and reboot and see what I get.

one more question... would my group_name_here be the same as my username_here? I dont really know what group my username "administrator" is under.
 
Old 06-27-2008, 05:22 PM   #8
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You don't need to reboot

mount -a

will do it

You may not need the group, but my users can be members of more than one group, and for samba I want them to use a specific group
 
Old 06-27-2008, 05:27 PM   #9
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
When I first made the entry into my fstab, I got a popup window in X saying something like "new medium found" or something of that nature, with two options, one being open or browse. so i clicked open/browse, and I got a permission denied message.

so I removed gid, and did a mount -a, and now this message appears:

mount error: could not find target server. TCP name fileserver/1x300 not found
No ip address specified and hostname not found

ping fileserver comes up as: unknown host: fileserver.

I didnt change anything on the fileserver, so I vnc'd to my mediacenter and pinged the fileserver, and got a reply.
 
Old 06-27-2008, 05:37 PM   #10
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
I just tried using the fileserver IP instead of netbios name, and again got the message that says:

A new medium has been detected. What do you want to do?
Medium type: Unmounted samba (microsoft network) share

the two options are: Open in new window, and Do nothing.

This time, Open in new window worked.

However, i dragged a file from my desktop over to the window that opened, and I got a message saying:

Could not change permissions for: /mnt/z/kjl.doc

As I tried to copy the same file again to bring the message up to tell you exactly what it said, It actually copied this time.

weird.
 
Old 06-27-2008, 05:48 PM   #11
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
Ok, I rebooted to make sure everything worked right, and it did not.

/mnt/z was empty after a reboot.

a simple mount -a fixed everything.

so the shares are still not connected automatically after a reboot.
 
Old 06-27-2008, 05:57 PM   #12
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Can you post your fstab entry?

Does your firewall let samba through?
 
Old 06-27-2008, 06:22 PM   #13
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
heres my fstab entry:

//192.168.1.10/1x300 /mnt/z cifs username=administrator,password=xxxxxx,_netdev,uid=administrator 0 0

I dont think I have any software firewalls running. There was one on my vector linux fileserver, but it is disabled, for exactly this purpose. plus, all my machines on my lan are behind a hardware firewall to the outside world.

I'm running pclinuxos2007 on my desktop, which is the one we're working on.

I didnt notice anything that looked like a firewall when I ran ps ux. is there a way to check for sure?


Thanks for your help billymayday. I'm leaving for a weekend getaway with my girlfriend as we speak, so I will be back sunday evening to continue working on this.
 
Old 06-27-2008, 06:36 PM   #14
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Have a nice trip
 
Old 06-27-2008, 07:03 PM   #15
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Have a read of man mount.cifs

I'd assume it would ne iptables, so ps aux | grep iptables should help
 
  


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
Mounting samba shares at startup somebodycr Linux - Software 7 09-17-2010 06:20 AM
Auto-mounting samba shares at startup calande Linux - Software 5 02-13-2007 09:23 AM
samba shares take an age to connect miner49er Linux - Software 5 09-20-2006 01:38 PM
Samba can't connect to Windows shares soren625 Linux - Software 2 01-22-2005 08:25 AM
Can't connect to Windows shares w/ Samba everythingand2 Slackware 7 01-15-2005 10:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:27 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