[SOLVED] Can't mount Samba share

Issues related to configuring your network
Post Reply
guitarguy12387
Posts: 13
Joined: 2011/11/01 00:43:03

[SOLVED] Can't mount Samba share

Post by guitarguy12387 » 2011/11/01 01:05:46

Hey everyone,

I am a bit of a newbie (especially to samba), so bear with me!

I'm trying to set up a Samba share on my CentOS 6 box to serve my Mac/Windows machines.

I have followed this howto:
http://wiki.centos.org/HowTos/SetUpSamba

This is the only thing I have changed in smb.conf (i added these lines)
[code]##### My Modifications #####
[smb_group]
comment = General Samba Group
path = /mnt/data
valid users = user1 user2 user3
public = yes
writable = yes
printable = no
create mask = 0775[/code]

I have tried disabling the firewall and changing the permissions on /mnt/data to 777.

Here is the result of this command: ps aux | grep smb
[code]root 10051 0.0 0.0 203560 3372 ? Ss 14:39 0:00 smbd -D
root 10053 0.0 0.0 203560 1660 ? S 14:39 0:00 smbd -D[/code]

However, I am unable to mount the share. I am primarily trying to mount on my OSX Leopard Mac. When I try to mount with this command:
sudo mount -t smbfs //user1@192.168.1.146/mnt/data ./mounts

I receive this error:
[code]mount_smbfs: mount error: /Users/user1/mounts: Broken pipe[/code]

I have also tried to mount on my ubuntu machine to no avail.

Since I am able to get to the point where I am asked for my samba password, it feels to me like a permissions issue, but I don't know how.

Does anyone have any ideas why this isn't working or what I can do to troubleshoot further?

Thanks in advance.

P.S. on a semi related note, if I do a port scan (nmap) AFTER disabling the firewall, it looks exactly the same as if I do a port scan while the firewall is enabled. I didn't expect this. Is this expected behavior?

r_hartman
Posts: 706
Joined: 2009/03/23 15:08:11
Location: Netherlands
Contact:

Re: Can't mount Samba share

Post by r_hartman » 2011/11/01 08:49:51

Can't really comment on the Samba bit, but have you tried setting selinux to permissive, just to verify it's not blocking?
[code]# setenforce 0[/code]
If it works with selinux in permissive mode, then find and correct the blocking isuues.

User avatar
TrevorH
Forum Moderator
Posts: 28867
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can't mount Samba share

Post by TrevorH » 2011/11/01 09:21:58

[/quote]
path = /mnt/data
[/quote]

It's almost certain to be an SELinux issue since this is a non-standard path. You'll need to add this using semanage then run restorecon to change the selinux context of /mnt/data. This [url=http://danwalsh.livejournal.com/14195.html]article[/url] should help out.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Can't mount Samba share

Post by pschaff » 2011/11/02 21:38:27

See also the SELinux comments in /etc/samba/smb.conf and [url=https://www.centos.org/modules/newbb/viewtopic.php?topic_id=33713&forum=59&post_id=144790#forumpost144790]this post[/url].

guitarguy12387
Posts: 13
Joined: 2011/11/01 00:43:03

Re: Can't mount Samba share

Post by guitarguy12387 » 2011/11/05 20:11:56

Hey everyone,

Thanks for the help. I have temporarily disabled SELinux for debugging purposes, but unfortunately, it seemed to make no difference.

I've also switched to sharing /home/samba_export directory.

For what it's worth, I get this error when trying to mount in OSX Leopard

mount_smbfs: mount error: /Users/user1/mounts: Broken pipe

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Can't mount Samba share

Post by pschaff » 2011/11/07 00:39:36

A [url=http://www.google.com/search?q=Leopard+mount_smbfs+mount+error++Broken+pipe&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a]google on the error[/url] indicates it is a common problem, seems to be on the Mac side, and I did not find an immediate solution in the first few hits, but you might be better motivated to read more of them. :-) I prefer NFS for Mac file sharing as it seems more straightforward, robust, and reliable.

Can you access the share from Windows or using smbclient on Linux or the Mac?

guitarguy12387
Posts: 13
Joined: 2011/11/01 00:43:03

Re: Can't mount Samba share

Post by guitarguy12387 » 2011/11/11 14:57:51

Hello,

Yeah, I didn't find much decisively on google right away, but after broadening my search, much more came available.

Anyway, the problem turned out to be a combination of things, I think: SELinux, Firewall, and OSX problems.

When I tried to mount in Ubuntu, I was having SELinux and firewall issues blocking me. Thanks to you folks, I was able to figure out that I needed to manage SELinux better.

I tried mounting on my Windows box, and it worked like a charm. So now to debug the OSX side.

I looked into nfs as well, but I was under the impression that Samba is usually pretty straightforward for noobs like me :P

Anyway, thanks for the help!

guitarguy12387
Posts: 13
Joined: 2011/11/01 00:43:03

Re: Can't mount Samba share

Post by guitarguy12387 » 2011/11/14 03:51:48

In case anyone runs into this in the future, I found out the solution to the OSX side:

When you do "Connect to Server" you must specify the port name. This is what I did to mount successfully:

[code]smb://user1@192.168.1.1:139[/code]

FYI, i'm using OSX Leopard 10.5.8.

Not sure if this is still how it works in later releases.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

[SOLVED] Can't mount Samba share

Post by pschaff » 2011/11/14 16:26:01

Thanks for reporting back. Glad to see my speculation that the problem was on the Mac side confirmed. :-) Marking this thread [SOLVED] for posterity.

Post Reply

Return to “CentOS 6 - Networking Support”