f3fix
Fix fake flash drive capacity
TLDR
Fill a fake flash drive with a single partition that matches its real capacity
Mark the partition as bootable
Specify the filesystem
SYNOPSIS
f3fix [-hV] [-s SIZE] <device>
PARAMETERS
-h
Display help and exit
-V
Display version information and exit
-s SIZE
Specify real size in MiB (overrides f3probe cache)
DESCRIPTION
f3fix is a utility from the F3 (Fight Flash Fraud) suite designed to repair USB flash drives, SD cards, and similar storage devices that falsely report inflated capacities due to counterfeit firmware. These 'fake' drives allocate only a fraction of their advertised space, with the rest being fake and unwritable.
Typically used after running f3probe, which determines the real capacity, f3fix shrinks the existing partition table to match the actual usable size. This prevents data loss from writes beyond the true capacity and allows reformatting to the correct size. It operates non-destructively on data within the real area but requires backing up data first, as partition changes can lead to loss.
The tool reads the probed size from f3probe's cache file (~/.f3probe/device) or accepts a manual size specification. It uses standard tools like parted to resize partitions, delete oversized ones, and create new ones fitting the real capacity. Success depends on the drive's firmware; some counterfeits resist fixes. Always unmount the device and run as root.
CAVEATS
Runs as root; risks data loss—backup first. Device must be unmounted. Not all fake drives fixable. May fail if no f3probe cache or invalid size.
TYPICAL WORKFLOW
1. f3probe --destructive /dev/sdx to find real size.
2. f3fix /dev/sdx to resize partitions.
3. mkfs.vfat -F 32 /dev/sdx1 to reformat.
CACHE LOCATION
f3probe creates ~/.f3probe/<device> with size data used by f3fix.
HISTORY
Developed by Michel Machado as part of the F3 project (2012+), targeting counterfeit storage fraud prevalent in markets. f3fix added to handle post-probe repairs, evolving with Linux storage tools.


