[chbot] Unlocking a microSDHC or SDXC card

Helmut Walle helmut.walle at gmail.com
Mon Jan 14 09:19:28 GMT 2019


I initially thought of that option, too, but dd should refuse writing to the card if it's 
locked, shouldn't it? If that is the case, then "special blablasoft" could be exactly what is 
needed to take care of it.
And I remember some noises from ages ago that Android may sometimes be playing with the card in 
ways that lock it... There was this "feature" where you can tell Android to use the card as 
"internal" memory, and that may somehow tie it to the phone in a way that then causes issues 
when trying to use the card like a "normal" card later on. But that's about the extent of my 
memory retention on this question.

And does this lead anywhere: https://github.com/BertoldVdb/sdtool ? From the source - sounds 
promising:

void printHelp()
{
     printf("This program requires two arguments. The first argument is the device to use. The 
second argument one of the following actions:\n");
     printf("  status:   show current write protection setting\n");
     printf("  unlock:   disable write protection\n");
     printf("  lock:     enable temporary write protection\n");
     printf("  permlock: enable permanent write protection\n");
     printf("  reset:    send go_idle_state command to all cards\n\n");
     printf("Example: ./sdtool /dev/mmcblk0 lock\n");
}

Kind regards,

Helmut.


On 14/01/2019 18:18, Volker Kuhlmann wrote:
> On Mon 14 Jan 2019 15:30:22 NZDT +1300, Trevor Wignall wrote:
> 
>> The cards worked for a year or more, then each suddenly stopped working in
>> the phone, and the phone no longer offered it. A new card then worked
>> perfectly in the phone, so it looks like a software write protect on the
>> card, or something else corrupted.
> 
> Are you sure this is even possible? There is a small encryption secured
> area, but the whole lot?
> 
> It looks suspiciously like 2 SD cards with hardware faults to me.
> 
>> I don't have any Linux computers other than my Raspberry Pi's, but I will
>> try to bring the cards (and adaptors) to the next meeting (in one week's
> 
> The RPi will be just fine. Find out which /dev/sdX device appears when
> you insert the card. The command is
> 
>    dd bs=1M if=/dev/zero of=/dev/sdX
> 
> and needs to run as root. On Debbian you need to prepend "su " (no
> quotes). Replace sdX as appropriate! For a reliable harakiri on the card
> you only need to write the first 512bytes to 2M, the rest just zeroes
> leftover file chunks.
> 
> WARNING: This will overwrite the whole of the card with no questions
> asked. It always works. There is no idiot protection, neither from the
> OS nor the system software, so if it doesn't work, you have a hardware
> problem. Replace under warranty.
> 
> No need for any special blablasoft for formatting that may have all sorts
> of loser protection built in...
> 
> Happy to help out but I'll be at linuxconf and probably won't have
> energy left for other meetings.
> 
> Volker
> 



More information about the Chchrobotics mailing list