-2
\$\begingroup\$

I'm a noob trying to find a solution to make a sd card write/read only? Like creating files is possible but to delete something you have to format the whole card. You only can delete everything or nothing. What are basic approaches to get there? Thanks for your help!

\$\endgroup\$
  • 3
    \$\begingroup\$ This is not possible. SD cards manage sectors, but have no notion of filesystem. (Or very, very, very difficult, as creating a custom chip able to analyse accesses, or reverse-engineer an existing card and download a new firmware... ). \$\endgroup\$ – TEMLIB Feb 20 '16 at 12:10
1
\$\begingroup\$

creating files is possible but to delete something you have to format the whole card.

That won't be possible with FAT16/32 or ExFAT filesystem. You have to re-write FAT and directory sectors to create new files.

There are special write-once cards for forensic purposes, but once written to they do not allow creating new files.

\$\endgroup\$
  • \$\begingroup\$ But would re-writing the filesystem make the card unusable for card readers in cameras e.g.? \$\endgroup\$ – Jay Kay Feb 20 '16 at 13:50
  • \$\begingroup\$ The card only knows two operations, read and write. You can't disable the write operation, since you need to write to the FAT and directory sectors (this is what Turbo J said) to create files. The card has no idea if you are writing to make a new file or delete an old one. You should read up on how the FAT filesystem works to understand how the filesystem interacts with the card's basic operations. \$\endgroup\$ – Austin Feb 20 '16 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.