Thoughts on using write protected micro SD card?

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
rosswesleyporter
Posts: 18
Joined: Tue May 24, 2016 6:57 am

Thoughts on using write protected micro SD card?

Post by rosswesleyporter »

Hello. Thoughts on using the crazy idea of using a write protected micro SD with Diet Pi on a Pi A+ for a standalone music player?

I published plans (DQMusicBox) for a simple music player for people with dementia. I'd like to make it more resistant to unexpected loss of mains/power. I quite like DietPi for that. I'm *thinking* of taking it a step further and using hardware write protection on the micro SD card. More specifically, setting the TMP_WRITE_PROTECT bit on card's CSD (Card Specific Data).

I did a quick test of this. Superficially, it seems to work. That is, DietPi boots and I can play music. However, it works in an interesting way. The micro SD still accepts write requests, but it never actually writes anything.

If I were to do this, I would use a tiny writeable USB memory stick to store the music. I recognize that this would make it more difficult to update the device. Note that the device is intended to be standalone i.e. generally not on a network.

Using hardware write protection is a pretty big hammer. And I would lose a lot of capability. But perhaps I would still have the capabilities that the device needs.

Thoughts? Crazy?

Note that the write protection mechanism above is *not* the old-style slider switch on big SD cards, rather it's a bit setting on the card itself. Thus it can be enabled and disabled in software. A few links about this:

http://www.bertold.org/sdtool/
http://users.ece.utexas.edu/~valvano/EE ... r_Spec.pdf
http://hackaday.com/2014/01/18/the-tini ... rd-locker/
http://www.seanet.com/~karllunt/sdlocker.html

Thanks,
Ross
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: Thoughts on using write protected micro SD card?

Post by k-plan »

Hi Ross,

there is a open ticket on github for a request : Read only filesystem option

https://github.com/Fourdee/DietPi/issues/229

But priority low and no milestone so far.


http://fuzon.co.uk/phpbb/viewtopic.php? ... 1463#p1459
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
rosswesleyporter
Posts: 18
Joined: Tue May 24, 2016 6:57 am

Re: Thoughts on using write protected micro SD card?

Post by rosswesleyporter »

Thanks for the response. I'll probably test this empirically. That is, enable hardware write protection then use the Pi / music player, unplugging it frequently, see if it survives. Should be interesting.
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: Thoughts on using write protected micro SD card?

Post by k-plan »

Hi,

tested on a clean DietPi Jessie (v.119) RPi3 installation like described here: https://hallard.me/raspberry-pi-read-only/

Used it, because it use only "on-board-tools" from Debian Linux.
Works "out-of-the-box" witch some really small modifications.
Like the feature of easy switching and showing ro/rw state. Really impressive.

But if you install additional software, it will be tricky to get it cleanly to work.
You have to know, where and which files will need to store while software is running.
So it can be tricky to get each software to run proper, have store settings, logfiles and states. (e.g. testing witch RPi-Monitor)
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
Post Reply