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

CIFS Issues: Samba/Linux

Discussion in 'Tomato Firmware' started by scurker, Feb 11, 2009.

  1. scurker

    scurker Addicted to LI Member

    I recently installed Tomato on my WRT54G v4 router and am looking to move the bandwidth logs off the router. I successfully setup my Samba share on my Ubuntu box so that it could be reached from my Win7 machine under the share "routerlogs". Unfortunately, I am having some issues getting it to work from the router as I am getting the following error:

    user.err kernel: CIFS VFS: cifs_mount failed w/return code = -1

    I have been using the following format for the client:

    Code:
    UNC=\\192.168.1.145\routerlogs
    Username=scurker
    Password=mypassword
    I've tried various solutions trying to fix the problem and have been unsuccessful for the past several hours. Here's my current samba setup:

    Code:
    [global]
    
    workgroup = SCURKER
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
    
    passdb backend = tdbsam
    security = user
    ;null passwords = true
    username map = /etc/samba/smbusers
    
    syslog = 1
    syslog only = yes
    
    usershare owner only = False
    security = share
    
    log file = /var/log/samba/log.%m
    ;invalid users = root
    
    [routerlogs]
      comment = Tomato logs
      path = /var/routerlogs
      browseable = yes
      read only = no
      writable = yes
    
    I am successfully able to mount via CIFS on my Ubuntu machine but can't seem to do so on the router. Fortunately, I was able to eventually mount on my Win7 machine, but this isn't ideal as I often have downtime on this machine to switch OSes and would like to keep the logging on a machine that has more uptime. Is there any insight on what I could possibly be doing wrong?
     
  2. Eiríkr

    Eiríkr Addicted to LI Member

    Your smb.conf file is a bit of a mess. Frankly, I'm surprised you were able to mount this at all -- it's tangled enough that it simply shouldn't work. I've seen many examples of smb.conf file contents borrowed from elsewhere online, often containing unneeded options, unnecessary default options, borked bad options... Anyway, you've got some extraneous fluff options, some redundant options, some conflicting options, some maybe unneeded options, and a possible username blackhole.

    ------------------------------
    Fluff Options

    syslog = 1
    browseable = yes

    Already the default values. Omitable.


    Redundant Options

    read only = no
    writable = yes

    These are inverted synonym options. Here, they both say the same thing -- you only need one or the other. Thankfully, they at least agree with each other, so even though you have both here, it doesn't cause any real trouble, aside from making your smb.conf file bigger and more confusing than it needs to be. :)


    Conflicting Options

    security = user
    security = share

    The user value is the default, and is generally preferable. Whatever you decide to use, you can't set both user and share at the same time. Read the man page for the security section, linked right above.


    syslog only = yes
    log file = /var/log/samba/log.%m

    From the man page for the logfile section:
    From the man page for the syslog only section:
    So if you're going to only log to the syslog, you don't need to specify the log file. Or, if you want to log to the log file you specify here, you cannot set syslog only = yes.


    Maybe Unneeded Options

    usershare owner only = False
    If you don't know what usershares are, you don't need this. Besides which, you're missing other options required for usershares to work properly. Check the man page section about usershares for details.


    Possible Username Blackhole

    username map = /etc/samba/smbusers
    This optionally specifies the file that maps Samba client usernames to Linux usernames on the Samba host. Does this file exist? What's in this file? Do you need username mapping? Are you sure this file is properly configured?
    ------------------------------

    I'd suggest you read over the man page sections linked here, figure out which options you really don't need, and streamline your smb.conf file to contain the bare minimum.

    HTH! Cheers,

    -- Eiríkr
     
  3. scurker

    scurker Addicted to LI Member

    Thank you for your help, I'm not sure how I could've missed all of that. My smb.conf had started to get so cluttered from my constant changes that it was bound for something to get screwed up. I didn't realize I still had security = share in there and I think taking that out fixed my problem. Even stranger that I was still able to mount successfully in Ubuntu and Win 7 with all of that mess.

    Here's my new (cleaned up) smb.conf file for anyone interested.

    Code:
    [global]
    workgroup = SCURKER
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
    
    passdb backend = tdbsam
    security = user
    username map = /etc/samba/smbusers
    
    log file = /var/log/samba/log.%m
    
    [routerlogs]
      comment = Tomato logs
      path = /var/routerlogs
      writable = yes
    
    After this, I was able to mount in tomato. Thanks for your help again!
     
  4. Eiríkr

    Eiríkr Addicted to LI Member

    I'm over on the Ubuntu networking forum a lot, where I try to help folks squash Samba config issues, so I guess I've had a little practice. :) Glad it came in handy!

    Cheers,

    -- Eiríkr
     

Share This Page