[Samba-Technical] Wrtiing files from one linux to another linux

Urban Widmark urban at teststation.com
Fri Aug 30 11:33:01 GMT 2002


On Fri, 30 Aug 2002, Kevin Liao wrote:

> called an embedded system. Anyway the local machine will try to smbmount to
> the remote machine which is just a normal PC with linux installed. After the
> connection has been established successfully, the local system begins
> writing files continuously to the remote end. Therefore, what we want to do
> is to detect whether the file had been really saved in the remote storage
> device and if something goes wrong we may smbmount to another remote machine
> then keep working.

To be "sure" the data is actually on disk you will need to do fsync. That
is true for nfs as well (and you should consider using that instead).

There is really nothing the client can do beyond fsync to detect if the
server has written it to disk.

As Andrew Bartlett said, the default setting of 'strict sync' is that
samba lies to the client and says "yes, I've written it to disk" when it
in fact has not.


Regarding memory use, smbfs does not cache anything itself. It lets the
kernel MM system to that for it (using the pagecache). When using mmap you
can give hints on how you are accessing a file using madvise. But I don't
know how well that works.

Also note that when the system is low on memory the cached pages will be
reused for other things. I believe details on how to tune certain MM
parameters can be found in the kernel documentation.

/Urban






More information about the samba-technical mailing list