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 <device>
DESCRIPTION
f3fix is a utility from the f3 (Fight Flash Fraud) project, designed to adjust the apparent size of fraudulent flash drives. These drives report a larger capacity than they physically possess, leading to silent data corruption when data is written beyond the actual usable space. After utilities like f3write fill the drive with test data and f3read verifies the actual usable space, f3fix can be used to truncate the file system or partition table to reflect the true, usable capacity. This effectively makes the drive usable by preventing attempts to write data to non-existent sectors. It does not physically repair bad sectors or increase capacity; it only makes the operating system see the correct, smaller, usable size, thereby mitigating data loss.
CAVEATS
Data Loss: Running f3fix modifies the partition table or file system metadata. Any data residing outside the *true* capacity of the device will be irrevocably lost. It is crucial to back up any important data before running this command.
Irreversible Changes: The modifications made by f3fix are generally irreversible without manually re-partitioning and re-formatting the drive, potentially back to its original (fake) reported size.
Requires Prior Testing: f3fix should only be run after f3write and f3read have been used to accurately determine the actual usable capacity. It relies on the information gathered by f3read.
No Physical Repair: This utility does not fix physical damage, bad sectors, or increase the drive's capacity. Its sole function is to adjust the reported size to match the true physical capacity.
HOW IT WORKS
f3fix operates by identifying the last successfully written block, as determined by the f3read utility. It then modifies the partition table (e.g., MBR or GPT) or the file system's internal metadata (like the superblock for filesystems such as FAT32, ext4, etc.) to reflect this actual, smaller capacity. This process effectively 'shrinks' the drive's reported size to match its true physical limits, preventing the operating system from attempting to write data to non-existent sectors beyond the physical capacity.
HISTORY
The f3 (Fight Flash Fraud) project was initiated by Michel Machado to combat the widespread issue of fraudulent USB flash drives and SD cards sold with inflated reported capacities. f3fix is a core component of this suite, developed to offer a practical solution for users to repurpose these fake drives. By truncating the drive to its true usable size, it prevents silent data corruption that would otherwise occur. The project empowers users to identify and manage such deceptive storage devices, providing tools for both testing and remediation.