Troubleshooting


Samba provides three utilities that can help you troubleshoot a connection: The smbstatus utility displays a report on open Samba connections; testparm checks the syntax of /etc/samba/smb.conf and displays its contents; and testprns checks the validity of the name of a printer.

The following steps can help you narrow down the problem when you cannot get Samba to work.

  1. Restart the smbd and nmbd daemons. Make sure the last two lines of output end with OK.

    # /sbin/service smb restart Shutting down SMB services:                                [  OK  ] Shutting down NMB services:                                [  OK  ] Starting SMB services:                                     [  OK  ] Starting NMB services:                                     [  OK  ]

    testparm


  2. Run testparm to check that the smb.conf file is syntactically correct:

    $ testparm Load smb config files from /etc/samba/smb.conf Processing section "[homes]" Processing section "[printers]" Processing section "[tmp]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions ...

    If you misspell a keyword in smb.conf, you get an error such as the following:

    # testparm Load smb config files from /etc/samba/smb.conf Unknown parameter encountered: "workgruop" Ignoring unknown parameter "workgruop" ...

    ping


  3. Use ping (page 365) from both sides of the connection to make sure the network is up.

    net view


  4. From a Windows command prompt, use net view to display a list of shares available from the server (pb in this example):

    C:>net view \\pb Shared resources at \\pb pb Samba Share name   Type   Used as Comment -------------------------------------------------------------------- MainPrinter  Print           MainPrinter mark         Disk   (UNC)    Home Directories tmp          Disk            mgs temp The command completed successfully.

    net use


  5. Try to map the drive from a Windows command prompt. The following command attempts to mount the share named tmp on pb as drive X:

    C:>net use x: \\pb\tmp The command completed successfully.

    nmblookup


  6. From the server, query the nmbd server, using the special name __SAMBA__ for the server's NetBIOS name. The d 2 option turns the debugger on at level 2, which generates a moderate amount of output:

    $ nmblookup -d 2 -B pb __SAMBA__ added interface ip=192.168.0.10 bcast=192.168.0.255 nmask=255.255.255.0 querying __SAMBA__ on 192.168.0.10 Got a positive name query response from 192.168.0.10 ( 192.168.0.10 ) 192.168.0.10 __SAMBA__<00>

    nmblookup


  7. From the server, query the nmbd server for the client's NetBIOS name. (The machine named jam is the Windows client.)

    $ nmblookup -B jam \* querying * on 192.168.0.9 192.168.0.9 *<00>

    Omit the B jam option to query for all NetBIOS names.

    smbclient


  8. From the server, use smbclient with the L option to generate a list of shares offered by the server:

    $ smbclient -L pb Password: Domain=[PB] OS=[Unix] Server=[Samba 3.0.10-1.fc2]         Sharename      Type      Comment         ---------      ----      -------         tmp            Disk      mgs temp         IPC$           IPC       IPC Service (pb Samba)         ADMIN$         IPC       IPC Service (pb Samba)         MainPrinter    Printer   MainPrinter         mark           Disk      Home Directories Domain=[PB] OS=[Unix] Server=[Samba 3.0.10-1.fc2]         Server               Comment         ---------            -------         Workgroup            Master         ---------            -------         MGS                  TUNAER

    nmblookup


  9. To query for the master browser from the server, run nmblookup with the M option followed by the name of the workgroup:

    $ nmblookup -M MGS querying MGS on 192.168.0.255 192.168.0.8 MGS<1d>




A Practical Guide to Red Hat Linux
A Practical Guide to Red HatВ® LinuxВ®: Fedoraв„ў Core and Red Hat Enterprise Linux (3rd Edition)
ISBN: 0132280272
EAN: 2147483647
Year: 2006
Pages: 383

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net