[Samba] Make CIFS look like NFS

Daniel L. Miller dmiller at amfes.com
Mon Jun 8 16:28:17 GMT 2009

Edward Ned Harvey wrote:
>> I'm trying to run an IMAP mail server (Dovecot) in a virtual machine.
>> However, I do not want the messages stored within the virtual disk.  So
>> - the question was how the virtual machine could access those files.
>> Dovecot has been setup and tested with NFS.  However, when I asked
> The best answer to this question is exactly what you're doing - testing it will give you results probably more convincing than anything anyone could say to you.  That being said ...
> NFS is a more native network filesystem for unix machines, so it really only makes sense to use samba if you have some compelling reason not to use NFS.  Do you have some reason NFS would be bad in this case?
I had tried NFS previously - and didn't enjoy it.  I had numerous 
lockups.  Samba appeared to provide a much more fault-tolerant 
environment.  I will admit it's possible there were physical 
connectivity issues that have since been corrected.

> There are many differences between samba and nfs, however, there are only two that I think are likely to be true roadblocks for you.  File permissions ... In samba you can configure the umask to be whatever you like, but you can't do it on a file-by-file basis.  So you're missing granularity there if you need it.  And in samba, certain characters (most notably the ':' colon character) are not valid.
For Maildir support, the colon character is a necessity (at least under 
Dovecot).  It'd be neat if Samba had an option to allow non-Windows 
legal characters in filenames.  However, Dovecot has another format 
(dbox) that uses standard characters, so that gets around the filename 
> There may be some difference in the way file locking is handled.  This would only matter if you had more than one system accessing the same files at the same time - but I don't think that's the case for you, huh.  Because it's an imap server, and you're not going to run two separate imap servers on the same directory.
> The issue you mentioned with missing tmp files ... sounds bogus to me.  I can't think of any way samba could cause that, unless it's just a side-effect of one of the aforementioned possible roadblocks.
What I saw happening was temp files would be created, but not deleted - 
and they had what looked like Samba-specific names (I haven't tried this 
is a month, sorry I'm not more specific).  The files could not be 
deleted unless I broke the connection.  I'm assuming that Dovecot was 
trying some kind of file-locking request that works on local or NFS 
files - but seems to break horribly under CIFS.  That's really what I'm 
asking about I guess - what difference is there in how CIFS implements 
various filelock and fsync options compared with NFS (and there must be 
something, otherwise I wouldn't have had the problems).


More information about the samba mailing list