1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Samba share browsable, but cant open files.

Discussion in 'Web and Network Services' started by olav, Apr 25, 2010.

  1. olav

    olav New Member

    Messages:
    349
    Likes Received:
    0
    I'm trying to configure my first samba share. So far I can browse files, create folders and create "empty" files.

    I cant open files, I cant copy over files and I cant copy files from the samba share. This happens with both Ubuntu(Nautilus) and Windows 7.
    My smb.conf looks like this:
    Code:
    [global]
    	server string = Samba Server
    	log file = /var/log/samba/log.%m
    	max log size = 50
    	min receivefile size = 131072
    	socket options = TCP_NODELAY SO_SNDBUF=65536 SO_RCVBUF=65536
    	dns proxy = No
    	aio read size = 1
    	aio write size = 1
    	use sendfile = Yes
    
    [smil]
    	path = /home/olav
    	valid users = olav
    	admin users = olav
    	write list = olav
    	read only = No
    	map readonly = no
    
    What am I doing wrong?
     
  2. JimW

    JimW New Member

    Messages:
    95
    Likes Received:
    0
    A few things to check....

    Did you add a Samba account for the user with smbpasswd? If not, do the following as root...

    Code:
    smbpasswd -a olav
    Make the password the same as the FreeBSD login password (for convenience).

    You also didn't set security level in your Global section of the smb.conf file. Add the following (considering it seems you want user level security)....

    Code:
    security = user
    That might fix your problem. (Also make sure the user olav owns the directory /home/olav)


    You might also want to add something like the following to the share config part of your smb.conf file...

    Code:
     writable = Yes
     available = Yes
     create mode = 0644
     directory mode = 0754
    
    The "mode" statement will keep your newly created files from being tagged executable. You can adjust to your liking.

    Good Luck.
     
  3. JimW

    JimW New Member

    Messages:
    95
    Likes Received:
    0
    Oh yeah....

    I forgot to mention that you need to restart Samba every time you make a change to the smb.conf file. You can do that without a reboot by executing the following as root....

    Code:
    /usr/local/etc/rc.d/samba restart
    It might also be a good idea to add a "workgroup" line to the Global section of your smb.conf file. Make it whatever workgroup name your Windows machines use.

    E.g.

    Code:
    workgroup = Workgroup
    Good Luck
     
  4. phoenix

    phoenix Moderator Staff Member Moderator

    Messages:
    3,407
    Likes Received:
    1
    If possible, use reload instead of restart. Restart will close all active SMB connections, potentially leading to data loss if you have lots of connected clients. :)

    For home use, or where you are the only connecting, using restart is safe.
     
  5. olav

    olav New Member

    Messages:
    349
    Likes Received:
    0
    I've done all of your suggestions, still no change. Could this be a firewall issue? I've installed ipfw. I've also created a test folder which I chmod 777, cant copy or read from the folder either :(
     
  6. FBSDin20Steps

    FBSDin20Steps New Member

    Messages:
    283
    Likes Received:
    0
  7. JimW

    JimW New Member

    Messages:
    95
    Likes Received:
    0
    Have you tried Samba with IPFW temporarily disabled?

    Did you set up your AIO support correctly? The thread link below has more info in that regard....

    http://forums.freebsd.org/showthread.php?t=9187

    What version of Samba are you using? What version of FreeBSD?
     
  8. Ruler2112

    Ruler2112 New Member

    Messages:
    421
    Likes Received:
    0
    Check the permissions on the box you're connecting to to ensure read capability to the user that samba is using to connect as.
     
  9. olav

    olav New Member

    Messages:
    349
    Likes Received:
    0
    Thanks to your great suggestions, I figured it out!

    It was the options

    aio read size = 1
    aio write size = 1

    that caused my problems, commenting them out and restarting samba helped.
    Samba speed is ok, averaging around 25-30MB/s, full disk speed is 40MB/s.
    It is at least a lot faster than NFS, getting just 10MB/s there. File system is ZFS.