LinuxCommandLibrary

f3write

Test flash drive write speed and capacity

TLDR

Write test files to a given directory, filling the drive

$ f3write [path/to/mount_point]
copy

Limit the write speed
$ f3write --max-write-rate=[kb_per_second] [path/to/mount_point]
copy

SYNOPSIS

f3write [options...] DEVICE

PARAMETERS

--help
    Display usage information and exit

--version
    Display version information and exit

--force, -f
    Overwrite without confirmation prompt

--last-sec N
    Write only the last N sectors (for partial tests)

--min-file-size SIZE
    Minimum file size in MiB (default: 1)

--max-file-size SIZE
    Maximum file size in MiB (default: 256)

--file-size-ranges RANGES
    File size ranges like '1-32,64-256' in MiB

DESCRIPTION

f3write is a tool from the F3 (Fight Flash Fraud) suite designed to rigorously test the true capacity of flash storage devices like USB drives and SD cards. It writes numerous small files filled with incompressible random data across the entire device, mimicking real-world usage patterns. This detects counterfeit drives that falsely report higher capacities by hiding bad sectors or using overprovisioning tricks.

Unlike simple tools that write one large file, f3write uses varying file sizes (default 1-256 MiB) to stress-test allocation tables and wear-leveling. After writing, pair it with f3read to verify readability. The process fully consumes reported space, confirming if the device can sustain writes without errors.

Essential for verifying cheap flash media; run on unmounted block devices only. Overwrites all data irreversibly, so backup first.

CAVEATS

Extremely dangerous: overwrites all data on DEVICE. Use only on unmounted block devices (/dev/sdX). Requires write permissions (often root). Test reveals fake capacities but not other defects like slow speeds.

USAGE EXAMPLE

f3write --force /dev/sdb
Tests entire USB device at /dev/sdb with defaults.

DATA PATTERN

Generates entropy-maximized data (random-like, incompressible) to evade compression tricks in fake drives.

HISTORY

Developed by Michel Machado starting 2008 to combat fake flash drives in Brazil. F3 v7+ (2014+) refined algorithms for modern NAND. Widely used for SSD/USB validation; open-source under GPL.

SEE ALSO

f3read(1), badblocks(8), hdparm(8)

Copied to clipboard