Skip to content

fjosk/sdcard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sdcard

A small Linux toolkit to diagnose, stress-test, and reformat USB storage (SD/microSD cards via a USB adapter, and USB flash drives) for maximum device compatibility — e.g. rescuing a card that some devices call "corrupted".

Scripts

  • format.sh — main one-shot (destructive): auto-detect the target device → diagnose → counterfeit-check (f3probe) → reformat (capacity-adaptive FAT16 for ≤ 2 GB, FAT32 for larger) → full verify → clean & empty.
  • check.sh — read-only health check (identity, geometry, BPB, fsck -n, kernel log). Touches nothing.
  • format-variants.sh — fallback layouts for a finicky device that rejects the standard format (FAT16/FAT32, ± active flag, or superfloppy/no-MBR).

Usage

./format.sh                 # auto-detect device, thorough
./format.sh full            # + 4-pattern badblocks surface scan (slow)
./format.sh quick /dev/sdb  # skip full-capacity test, explicit device
./check.sh                  # read-only, no changes

Safety

Every destructive step is gated: the target must be **USB + removable + ≤ 16 GiB

  • not the root disk**; f3probe halts before reformat if capacity is counterfeit; an 8-second countdown lets you abort after the target is shown. Scripts are self-locating (logs are written next to the script).

Requirements

bash, sudo, f3 (Fight Flash Fraud), dosfstools, util-linux, e2fsprogs, udisks2.

See CLAUDE.md for the full design notes and the original forensic case (REPORT.md).

About

Linux toolkit to diagnose, stress-test, and reformat USB storage (SD/microSD cards + flash drives) for maximum device compatibility

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages