Is there any way to bypass a write protected disk when dealing with MMC cards ?
I have a really odd problem with one of my cards (nicked from my camera to put some music on to my phone for a long tube journey in a couple of days)
The card works fine in my camera, I can delete/format/take pictures all fine.
Put into the card reader on my SuSE 9.1 box I issue a mount -rw /dev/sdd1 /home/wayne/media I can then see the current contents of the card by looking at /home/wayne/media
Deleting anything causes no error, but the deletion is only temporary if I come out of and go back into the directory the files have reappeared.
Unmounting it and doing a mkfs -t vfat /dev/sdd1 again results in no error, but after either mounting it or doing a fsck I can see that the original files are still there.
If I use the camera to format it and then try and copy files to it (I now have an empty disk according to df) I get an error telling me it is read only.
After a while I gave up and tried it in a Win2000 box downstairs. Copy to, Delete and format all give me a "disk is write protected" error. Yet the camera can still write to it.
There are no write protect tabs on either the card or the reader, and I have tried other cards in the same reader on the same machines with no issues. However all my other cards are SD (which have little write lock switches on them) Is it possible that my camera is setting the write protect tab on this card when it formats it. and if so how do I use the card in anything else.
What I am wanting to do is force a format regardless, is this possible ?
Put into the card reader on my SuSE 9.1 box I issue a mount -rw /dev/sdd1 /home/wayne/media I can then see the current contents of the card by looking at /home/wayne/media
Deleting anything causes no error, but the deletion is only temporary if I come out of and go back into the directory the files have reappeared.
Unmounting it and doing a mkfs -t vfat /dev/sdd1 again results in no error, but after either mounting it or doing a fsck I can see that the original files are still there.
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.
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.
Hi Wayne
EEProm and flash both require a clear cycle which sets all the bits high. Once cleared, the data can then be written to the device. Not all devices require a high voltage for the erase - Most are rated for 5V... However, the recommended voltages do need to be adhered to, as do the timings of the erase & write strobes.
If the erase timings are too short, data persistence is a problem, likewise, if the write timings are short, data integrity can not be guaranteed.
Regards, Paul.
On Friday 12 November 2004 18:48, Wayne Stallwood wrote:
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.
On Friday 12 November 2004 7:04 pm, Paul wrote:
Hi Wayne
EEProm and flash both require a clear cycle which sets all the bits high. Once cleared, the data can then be written to the device. Not all devices require a high voltage for the erase - Most are rated for 5V... However, the recommended voltages do need to be adhered to, as do the timings of the erase & write strobes.
If the erase timings are too short, data persistence is a problem, likewise, if the write timings are short, data integrity can not be guaranteed.
Regards, Paul.
Ahh thanks for the insight there Paul, so my theory may still stand even if the specifics are a bit out :-)
The card that is failing is a "Viking 128MB" and from what I remember it was an emergency purchase when I was out and about somewhere with my camera and getting short on space. The sticker is on crooked and it certainly doesn't give the same impression of quality as the Kingston 256MB that does seem to work correctly.
Therefore in this case I am guessing that I have a card that is operating slightly out of spec.