Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a weird problem. I wrote a script that scans a directory on a samba share (a OpenSUSE server on the LAN) and uses cp to copy certain CSV files to the local Debian server web root at /var/www.

The script works absolutely fine if it encounters one file to copy, but if there are several, weird things happen.

The files get copied to the destination folder but end up heavily corrupted. It looks as though Debian is somehow mixing up the files to create a sort of hybrid.

A simple example

If in the source directory there are the files A.csv and B.csv, containing just a few rows, such as:


"123","Joe Bloggs","Birmingham","UK"
"456","Ann Other","London","UK"


"BBB","Mr Smith","Liverpool","UK"
"CCC","Mrs Jones","Cardiff","UK"

In the destination folder I have seen completely mingled content such as:


"BBB","Mr Smith","Liverpool","UK"
"123","Joe Bloggs","Birmingham","UK"


"123","Joe Bloggs","Birmingham","UK"
"456","Ann Other","London","UK"
"BBB","Mr Smith","Liverpool","UK"

And any other weird combinations you can imagine, including unknown character set characters, shortened lines (missing fields), missing delimiters, you name it.

I have received the same results regardless of if I use cp or rsync...and have Google for hours for a solution.

What gives? Can someone shed some light on this weird problem?

share|improve this question
It sounds like either the windows filesystem or samba has it's wires seriously crossed, but I really don't know what to make of that. – Caleb Jun 29 '11 at 12:44
Do a memory test on both machines involved. – Gilles Jun 29 '11 at 20:15
up vote 0 down vote accepted

I fixed it. I think Caleb was right that the smbfs mount point had become seriously corrupted or broken... a reboot of the Debian box solved it as this would have remounted the smb share.

There goes my uptime of over 40 days...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.