zero-dependency cli tool for diagnosing and repairing corrupted USB partition tables (MBR/GPT) on linux
usbrescue
It detects corruption states (blank device, valid MBR, valid GPT, MBR/GPT conflict, stale or CRC-invalid GPT), rewrites a fresh MBR or GPT partition table from scratch, and verifies the repair — all without calling external tools like fdisk, gdisk, or wipefs.