The following steps can help you narrow down the problem when you cannot get Samba to work.
-
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
-
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
-
Use ping (page 365) from both sides of the connection to make sure the network is up.
net view
-
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
-
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
-
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
-
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
-
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
-
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>