bertoldvdb / sdtool Goto Github PK
View Code? Open in Web Editor NEWA small tool for managing the write protection flag of SD cards.
Home Page: https://bertold.org
License: Other
A small tool for managing the write protection flag of SD cards.
Home Page: https://bertold.org
License: Other
┌ ~
└> % sdtool /dev/mmcblk0 unlock
[-] Failed to open MMC block device: Permission denied
┌ 1 ~
└> % please
[+] Found RCA for /dev/mmcblk0: AAAA.
Error 110
[-] Failed to send command: Connection timed out
I inserted my sd card, and ran after compiling. Unfortunately, there's no other information whatsoever to go on. What is error 110?
I've tried flipping the physical write protection for the sd card on the adapter, I get this error both times.
I tried with a card that is 1 day old and I know to be working fine. No matter the position of the physical write protection slider, I get error 110.
┌ ~
└> % sudo sdtool /dev/mmcblk0 unlock
[+] Found RCA for /dev/mmcblk0: 0001.
Error 110
[-] Failed to send command: Connection timed out
What's going on here?
[-] RCA not found. Make sure /sys/ is mounted. Run this program only on the main volume, eg. /dev/mmcblk0
Love sdtool! Works as advertised. However, when I write protected my linux raspberry image and rebooted, I got errors. Is this because linux is trying to write to the sd and now that it is protected, the boot process fails?
I was hoping to protect the linux image from being corrupted but maybe that's not possible,
I've tried several with my RPi 3b and none of them worked :-(
So I was trying to remove the temp write protection from my micro sd so I used manjaro Linux and installed sdtool using yay , but then it wasn't showing the SD card named as mmcblk or somethin but was showing sda or sdb , is there something wrong with installation of sdtool or what ,
Also I tried to replace the mmcblk0*p or whatever you told about in the readme , I replaced it with sda or sdb as it was showing when I used the command listing the drives, but then it said that such directory doesn't exist , what to do !? @wamserma @BertoldVdb @Remi-p #14
I first reffered to this post
It doesn't appear this utility supports interacting with an SD card connected via the SPI pins on the GPIO header. I point it at /dev/mmcblk2
but get a "Failed to send command: Function not implemented" response. Any thoughts on how this could be supported? (Possible driver/config issue?)
My insticts says there is.. but I haven't dug this yet.
Any thoughts?
Can any one explain me how can i install sd tool on kali linux.
Not issues yet, just a question:
could it work on a 32Th USB pen drive?
Cheers.
Running on a Pi Zero W under PiCore:
$ sudo ./arm-sdtool /dev/mmcblk0 status
[+] Found RCA for /dev/mmcblk0: 59B4.
Error 110
[-] Failed to send command: Operation timed out
This used to work, so does this indicate that my micro SD card has become faulty?
i get a syntax error word unexpected (expecting ")")
after executing the command after reboot it still says lock in pc and rpi
this is the output
[+] Found RCA for /dev/mmcblk0: 59B4.
[+] CSD unchanged.
[+] Write protection state: Off.
Not an issue, just a question.
Does this work for micro-sd cards?
Thanks!
On Fedora 33, the microSD card is mounting the device from /dev/sde# to /run/media/user/boot, but no block device shows at /dev/mmcblk* . I'm presuming the newer version of Fedora is using a different location now, and won't show the path you are looking for.
After locking the SD Card (my device has a slot for SD/mmc card -- not using a USB adapter), the sd card no longer "works".
Running Linux ubuntu 5.11.0-27-generic #29~20.04.1-Ubuntu SMP Wed Aug 11 15:58:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
After plugging the SD card in nothing happens.
I cannot run the unlock command as I get the following error: Failed to open MMC block device: No such device or address
It no longer shows up under /dev/mmcblk* (previously insertion would create /dev/mmcblk0).
Dmesg shows : mmc0: error -110 whilst initialising SD card
Unlocked SD cards continue to work.
The closest thing I could find was this issue from a similar tool:
alcooper/mmc-password-utils#1
thanks!
From SD Specifications:
"The password protection feature enables the host to lock a card while providing a password, which later will be used for unlocking the card. The password and its size are kept in a 128-bit PWD and 8-bit PWD_LEN registers, respectively. These registers are non-volatile so that a power cycle will not erase them. Locked cards respond to (and execute) all commands in the "basic" command class (class 0), ACMD41, CMD16 and “lock card” command class. Thus, the host is allowed to reset, initialize, select, query for status, etc., but not to access data on the card. If the password was previously set (the value of PWD_LEN is not 0), the card will be locked automatically after power on. Similar to the existing CSD register write commands, the lock/unlock command is available in "transfer state" only. This means that it does not include an address argument and the card shall be selected before using it. The card lock/unlock command has the structure and bus transaction type of a regular single block write command. The transferred data block includes all the required information of the command (password setting mode, PWD itself, card lock/unlock etc.)."
It gave me errors running on aarch 64 when I tried a status command. Instead it actually locked the card. I could not unlock until reboot.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.