Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add USB Port Reset Functionality for Recovering Fake/Corrupt SD Cards #20

Open
DRCRecoveryData opened this issue Jan 12, 2025 · 1 comment

Comments

@DRCRecoveryData
Copy link
Contributor

Hi,

Thank you for your work on OpenSuperClone!

I came across this blog post about recovering data from fake or corrupt SD cards using a USB port reset to handle bad sectors and improve read performance:
https://blog.wapnet.nl/2022/02/corrupt-sd-card-recovery/

Would it be possible to add a similar functionality to OpenSuperClone? Specifically, an option to reset the USB port when encountering errors, without requiring external hardware like a YKUSH, relay board, or devices supported by uhubctl.

Below is a simple example script I’ve been using for this purpose. It leverages a USB reset command to retry after a failed read:

#!/bin/bash
# Ensure you update /dev/bus to match your card reader
# Run as sudo and mount the disk (e.g., /media/thomas)

while true; do
    echo "Retrying read operation..."
    ddrescue -d /dev/sdb1 /media/thomas/backup/backup1.img /media/thomas/backup/backup1.mapfile
    sleep 1
    ./usbreset /dev/bus/usb/001/004
    sleep 1
done

Integrating such functionality would make OpenSuperClone even more versatile for recovering data from problematic SD cards.

Thank you for considering this feature!

@ISpillMyDrink
Copy link
Owner

Have you looked into Direct USB mode? It is able to perform two different kinds of USB resets on timeouts and is configurable.

direct_usb

reset_settings

I would assume that the USB port reset (which is enabled by default) would be functionally identical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants