On Friday 12 November 2004 10:07 am, Steve Engledow wrote:
Sounds like exactly the problem I'm having trying to use my ickle USB pen-disk. Except that does have a write-protect switch that I've tried in both positions. I've tried mounting it with the sync option but the result is no different apart from taking longer to unmount.
# mount /mnt/usb # ls /mnt/usb somefile.mp3 someotherfile.mp3 # rm /mnt/usb/* # ls /mnt/usb
# umount /mnt/usb
[wait a while so I can be certain any activity is over]
# mount /mnt/usb # ls /mnt/usb somefile.mp3 someotherfile.mp3
Bizarre! For a laugh, I even tried dd if=/dev/random of=/dev/sd0 but that didn't seem to make a dent either.
Right, I have convinced myself that this is something to do with writing voltages (or possibly in your case a faulty Pen Drive). Today I tried a different (but the same make/model) of reader and it wrote to the disk first time.
This is all total speculation, based on a completely hazy recollection of how Flash and EEprom memory actually works. I am satisfied enough with it to believe it as a valid theory until someone comes along with a better one. However nobody else should believe a word I am saying here :-)
Over simplifying how flash memory works there is a burst voltage required for a write operation (using a process called Fowler-Nordheim tunneling) this is why constant writing knackers the batteries on portable devices. I think that it may be possible for the following to happen.
Original data is written (with a strong write) New Data is written over original data or Original data is deleted (with a weaker write)
Now there remains a ghost of the original data, the memory controller then gets confused and only sees the Original (more persistent ) data.
I think my camera is a stronger writer than the card reader I was using, in certain circumstances and with certain media. I think that the card reader was unable to set the same bits that the camera had set. By changing the media (I think the SD/MMC thing was a red herring) I found media that was less sensitive to this.
The reason that Windows was behaving differently to Linux may be a simple as a difference in the USB Mass Storage code. Perhaps Windows reads back data it has written to check that writes are allowed, were as perhaps Linux simply checks for a read only flag on the media.
Overall I think that this is probably indicative of either failing media or interface hardware. I certainly am not going to trust that MMC card until proved wrong.
Anyway "Fowler-Nordheim tunneling" is a good one for next years excuse calendar.