When I plug in my USB flash drive (or SD card), it shows up on my computer as write-protected or read-only. I am unable to transfer data to it, nor can I modify or delete any files already stored on it. I also cannot repartition or reformat the drive using GParted or other tools, including Windows Disk Management, DiskPart. The drive does not have a write-protect switch.
Why did this happen and what can I do about it? Is there a way to remove the write protection?
This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this problem. Feel free to edit the answer to add additional details.
(To moderators) This question is thus intended to be a master dupe target. (Jargon of stackexchange.com, meaning to mark other similar questions as a duplicate of this.)
(TL;DR: Sorry for giving the answer here; a moderator deleted my anwser. I've fixed it following his/her request, but probably it's been missed.)
See the original question and answer in superuser.com. In short, probably all you can do is retrieve the data and throw away the device.