WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: SD card write protect switch  (Read 3722 times)

Offline Zill

  • Newbie
  • *
  • Posts: 25
SD card write protect switch
« on: October 15, 2015, 11:26:08 AM »
I have installed Tiny Core 5.4 on an SD card(SanDisk Extreme Plus).  I have done this because I want to have a physical switch for controlling if data can or cannot be written to the card.  If I slide the switch into the read only mode and then boot my system, I am still able to write to the memory card.  I had assumed that the switch stopped writes from happening at the card level, but this is making me question my assumption.  Is there a driver that I need to install to recognize the SD card switch?

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11243
Re: SD card write protect switch
« Reply #1 on: October 15, 2015, 12:11:32 PM »

Offline Zill

  • Newbie
  • *
  • Posts: 25
Re: SD card write protect switch
« Reply #2 on: October 20, 2015, 10:08:27 AM »
I tried several different units and it seems that all of them ignore the write protect switch.  In looking around I found some information that says the write protect switch is a trigger to the OS, and it is up to the OS to recognize it.  Based off of this I have two different ideas: either the SD card reader is not reporting the switch to the OS (which sucks because I can't change the internal hardware of these units), or that Tiny Core is not currently configured to recognize the switch and thus mark the card as protected.  I have looked at a few instructions for other Linux systems, but they don't seem to work for Tiny Core.  While I keep looking, if anyone could help point me in the write direction for testing if Tiny Core sees the write protect switch or not I would be most appreciative.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11243
Re: SD card write protect switch
« Reply #3 on: October 20, 2015, 08:54:49 PM »
Hi Zill
You could try using the  hdparm  utility and see what it reports:
Code: [Select]
tc@box:~/guilib/grabber/grabber-1.1$ hdparm -r /dev/sda3

/dev/sda3:
 readonly       =  0 (off)
tc@box:~/guilib/grabber/grabber-1.1$
Replace  sda3  with your device.

Offline Zill

  • Newbie
  • *
  • Posts: 25
Re: SD card write protect switch
« Reply #4 on: October 21, 2015, 12:22:10 PM »
So with the switch in the lock position and running the hdparm command it pops up saying that readonly = 0.  I guess that means that is the hardware causing problems and I will have to come up with something else.  Thanks for the help Rich.