Release Write-protect your SD card


dimag0g

Very Active Member
Joined
Jan 12, 2011
Messages
608
Location
Strasbourg, France
While looking for low-level SD software, I have found this program called sdtool, I want to share. The binary version for R-Pi works on the Pandora as well. You can use it to enable temporary write protection on your card:


sudo umount /dev/mmcblk0p*
sudo sdtool /dev/mmcblk0 lock
sudo sdtool /dev/mmcblk0 reset

Similarly, unlock will remove the write protection.

A word of warning: pandoras seem not to be able to recognize that the flag is set, so you'll have to manually remount the filesystem as read-only. Mounting write-protected card as rw will silently allow writes which in reality won't take place, resulting in weird filesystem errors (which fortunately won't affect the SD card but still can hand up programs accessing the SD card).
 
"Every card has two programmable flags, one for temporary write protection and

one to lock the card forever."

Does that mean i can lock my card forever?

Who dares to try this?
 
"Every card has two programmable flags, one for temporary write protection and


one to lock the card forever."


Does that mean i can lock my card forever?


Who dares to try this?
I have a 16 MB card which came with my first digital camera. Maybe I'll try this weekend =)
 
Update: I tried to permanently lock my SD card. The correct command for it is "perm", not "permlock". Anyway, the card just ignored the command and didn't lock.
 
Back
Top