[PLUG] Samba vs nfs

max.reid at saikonetworks.com max.reid at saikonetworks.com
Sun Feb 6 17:45:53 UTC 2005


> > > I recently built a share on my linux server that I am sharing with
> > > windows machines via samba.  I would also like to share this share with
> > > my linux machines as well.  Problem is, if I mount the share via smbfs
> > > it only allows read/execute access to users and only root has write
> > > permissions, windows clients can write to the share without problems.  I
> > > need my linux users to be able to write to this share as well.
> > >
> > > What I was wondering if it is possible to share a folder using 2
> > > different methods.  From my server can I share the folder via samba and
> > > also share the folder to my linux machines using nfs, or will I risk
> > > possible data corruption.
> > 
> > The problem with multiprotocol filesharing has to do with the differences
> > between locking mechanisms in NFS and CIFS when two users are accessing
> the
> > same file simultaneously using the different protocols.  If your kernel
> and
> > samba implementation supports CIFS opportunistic locking, you shouldn't
> have
> > this problem...
> > 
> 
> In theory, yes. In practice, if users are accessing same files
> simultaneously, locking is unreliable even with one protocol, and it's
> not just linux nfs issue, I've seen very flaky nfs behaviour on
> solaris and hpux as well.

 Basically, once you have a heterogeneous
> environment, if your file locking seems reliable, you haven't stressed
> the servers enough. They will start giving intermittent errors under
> load. So you basically have to accept that you're taking chances if
> you are support concurrent accesses.
> 

Hi Fedor,

Agreed, there are certain risks. NFS locking is more of an after thought in many
environments, and samba doesn't exactly have deep integration with the
underlying unix filesystem, however for light or moderate use, its a lot less
expensive than doubling disk or using seperate fileservers.   Also, keep in mind
that Microsoft essentially permits you to do the same thing if you are running
the NFS service on their fileserver product... and I personally have had fewer 
issues with the penguin/samba(or CIFS)/nfs combo than the windows/CIFS/NFS combo.

If the server is going to be heavily loaded enough to break things and/or
mission critical enough where having an occasional borked file is not an option,
then it might be easier to justify the disk overhead, seperate server or a
commerical product like a Netapp filer or EMC NAS box. 

Regards,
Max











More information about the PLUG mailing list