Samba and NFS
cnww at chebucto.ns.ca
Thu Jun 29 11:26:14 GMT 2000
At 19:28 29/06/00 +1000, you wrote:
>a customer asked me about the difference between using Samba and NFS.
AFAIK The answers are roughly the following:
The difference between Samba and NFS is primarily that Samba uses the SMB
(aka Lanmanager) protocol which is considered "standard" for PCs (Windows
and OS/2 both have built in support for it, a free client is also available
for DOS, I'm not sure about MacOS), whereas NFS uses its own protocol
(usually just called "NFS") which is not commonly available for PCs (NFS
clients do exist for operating systems other than UNIX/Linux, but they're
usually neither free or easy to setup).
Samba's SMB protocol allows the server machine to handle authentication, so
it can decide what files the client has access to based on the particular
machine and user connecting. NFS by default trusts all client machines
completely (it's really not intended to share files to unsecured
workstations) and lets the client machines handle authentication all on
their own (once an NFS server has been told to accept connections from a
client machine the client does not require any further server-side
authentication, and can do anything it wants with the filesystem NFS gives
it access to).
SMB does not (directly) support UNIX style file permissions, so it is
probably a bad idea to routinely use it to map filesystems between machines
which expect this information to be present and mutable, NFS of course
supports all standard UNIX file information (this also means that SMB is
fine for accessing a UNIX filesystem from a Windows machine, but not so hot
the other way around).
> He has also
> asked me if the filesystems exported with nfs can be also exported with
>Samba, and if the files being used can be locked properly.
Yes, Samba can share anything which is accessable as a filesystem on the
host upon which it is running.
File locking is a slightly more complex issue, two cases have to be
1. Creating a Samba share which contains (or is under) an NFS mount point:
This is fine.
2. Creating a Samba share which is equivalent to an NFS exported filesystem
on the same host:
This may not be fine. The problem is that Samba handles Windows-style file
locking internally whereas NFS uses UNIX-style file locking at the kernel
level. Problems can occurr if the same file is accessed by both SMB and NFS
at the same time. You can however prevent these problems from happening
through careful server configuration (allowing NFS and Samba to share the
same filesystem without any problems).
See http://us2.samba.org/samba/ftp/docs/textdocs/File-Cacheing.txt for
I should of course mention that I am not an expert, I may have left
"I've always wanted to be somebody. Next time I'll be more specific."
More information about the samba