Not all sockets even bother connecting up the switch contacts. In any case, it's up to the OS if it takes any notice of write protect on SD cards - it's not implemented in hardware.
As far as I know that's true[1]. It's not like it was with floppy disk drives where the write protect disabled the write amp circuit in the drive itself as well as setting a flag to the OS.
However, there still remains a possibility for the controller chip in the card reader to implement exactly the same mechanism for write protection as was standard with floppy disk drives so you can't totally rule this out (but manufacturers being what they are, this does seem unlikely).
[1] It's certainly true of the SD card slot in Canon P&S and 'Bridge' cameras otherwise the CHDK wouldn't be able to use the write protect as an indicator to autoload itself and allow the camera to *still* write to the card.
The kind that has an SDIO controller directly on the SoC - this is common in phones, tablets, cameras and some laptops. On this, the tab-detect switch is a GPIO to the SoC and software can do whatever it wants. On Linux this form shows up as /dev/mmcblk.
Or there's the kind where the card reader is connected by USB. In that case it presents as a block device to the PC (/dev/sdX on Linux), and there's no standardised means to indicate the write protect tab to the OS. This is likely to implement the write protect feature in the firmware of the USB card reader, so you can't un-protect from the OS.
Worth mentioning too that there are non-volatile write protect register bits on the SD card too which cameras frequently use to make everyone's life more difficult when managing card contents through external readers.
The setting of the write protect tab has no influence on these register settings.
On that subject, I don't suppose you've come across any utilities to manipulate SD card control registers via generic readers have you? I have an annoying camera that insists on setting the write protect bit every time it saves an image and it really gets on my t*ts. Sometimes you can persuade it to remove the write protection by powering it up straight into picture preview mode but it is by no means a reliable solution.
If you plug the card direct into an SDIO controller (/dev/mmcblk...) then you (or at least your OS) can send it the SD protocol CMDxx commands (eg CMD41). If you plug it into a USB reader I don't think there's a way to do that - it just claims to be a block device and there's no standard way to tell the computer it's an SD card, let alone send SD commands.
I haven't seen nonvolatile write protect commands in my reading of the SD and SDHCI specs, but SD has support for DRM so maybe they're in there somewhere. The specs are pretty complicated.
Unless you mean it's a filesystem write protect - permissions set to be r--r--r-- or equivalent?
That's useful thanks, I use a USB access device so would need to find a direct one.
It's not well known about and it's pretty pointless asking questions on general forums about them as the uninitiated can't understand you're not talking about the WP tab.
In the end I found the details by looking at a manufacturer's SD card data eg Sandisk (1.1MB, 113 page pdf):
formatting link
They're bits within the Card Specific Data (CSD) register (bits 12 &
13), PERM_WRITE_PROTECT, TMP_WRITE_PROTECT.
If you fancy a read, see section 3.5.3, page 3.13 & 3.14 plus other refs section 1.5.9.10 and 1.5.9.12 on page 1.10.
In the end it went too deep for me to spend time on.
I'd be tempted to get a Raspberry Pi or similar and hack the kernel to clear the TMP_WRITE_PROTECT bit - though you have a bit of chicken-and-egg in booting the Pi. Maybe there's a board that will boot off something that isn't SD so you have the SD slot clear.
Alternatively, it seems someone has programmed an ATmega to do it:
HomeOwnersHub website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.