0

Some days ago one of my micro sd cards (a 32gb by Samsung) "decided" it is protected. It has no physical switch and I haven't found a way to format it yet. Every software I try to use says it is protected or read-only. I hoped GParted would have helped me but it didn't. I believe it's just a software problem hoping to find a solution. Any idea? Maybe some Linux command? Ah, the sd is current in ntfs file system.

1
  • 1
    I might disagree that it's a software problem. How old is the card ? When my many cards failed, this was their final behavior. Also, did you try to format on another device with another adaptor ?
    – Lucas BS
    Aug 21, 2022 at 10:38

1 Answer 1

2

I have a linux command for you: hdparm

Set the readonly flag, card will be readonly:

markus@markus-ThinkPad-W530:~$ sudo hdparm -r 1 /dev/mmcblk0

/dev/mmcblk0:
 setting readonly to 1 (on)
 readonly      =  1 (on)

Clear the readonly flag, card wil be read-write:

markus@markus-ThinkPad-W530:~$ sudo hdparm -r 0 /dev/mmcblk0

/dev/mmcblk0:
 setting readonly to 0 (off)
 readonly      =  0 (off)

Query the readonly flag, 0 = readwrite, 1 = readonly:

markus@markus-ThinkPad-W530:~$ sudo hdparm -r /dev/mmcblk0

/dev/mmcblk0:
 readonly      =  0 (off)

Markus

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .