Pregunta

I have a linux box mounted to a windows share /mnt/somedire/ that points to a windows server. I have another windows application that writes xml files to the windows share. An ESB application on the linux box then uses the xml files on the mount.

When the xml files are generated and viewed through windows (notepad or notepadd++) they are fine. When viewed through linux via a cat, vi, etc command the last 5 or 6 lines of the xml are missing yet they are the same file.

Has anyone seen this before, and can you to me how to fix it?

¿Fue útil?

Solución

When you write to a file OS doesn't write immediately to your disk - it writes to multi-level caches: file system cache, block cache, device cache etc.

Periodically, caches are "flushed" - written to underlying device. That's what, for example, umount does.

So when your windows application writes some XML to file - it writes to NTFS cache. Reading this file on windows will be done through the same cache and that's why it consistent on Windows. But your Linux box does know nothing about that cache - it has it's own caches.

To avoid this problem you should write on Windows with direct I/O.

Otros consejos

It seems like it's a problem with your samba mounts. Your data is not getting flush on Linux.

Try umounting and remounting your samba share.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top