How to Check Real USB Capacity in Linux Terminal

So you bought a USB flash drive to create a Linux live USB. But how do you know it’s not fake?  f3, which stands for fight flash fraud, can test real USB capacity. This tutorial shows you how.

Install F3 on Linux

For Debian, Ubuntu, Linux Mint, Elementary OS users, f3 is available in software repository. Simply execute the command below:

sudo apt install f3

Arch Linux, Manjaro, Apricity OS users can install f3 from AUR repository with Yaourt package manager.

yaourt f3

Fedora-based distros:

sudo dnf install f3

Checking USB Capacity

Before testing the real capacity, make sure the data on the flash drive is backed up and then format it, which can be done with Gparted partition editor.

gparted-partition-editor-format-flash-drive

Close Gparted when it’s done.

Now back in your terminal,  use f3write command to let f3 write a file to your flash drive.

f3write /media/flash-drive-mount-point

When writing to flash drive, f3write fills the filesystem with 1GB files named N.h2w, where N is a number (i.e. /[0-9]+/).

f3 check usb capacity

Then use f3read command to check if the file can be read.

f3read /media/flash-drive-mount-point

f3-fake-flash-test

If you see from the output that some sectors are corrupted, then your USB flash drive is fake. You should ask for your money back.

f3probe

F3 also comes with a command line utility named f3probe, which is recommended for testing USB flash drives of large capacity due to its fast test speed.

First find out the block device name of your flash drive with lsblk command:

lsblk

Mine is /dev/sdb. Make sure you identified it correctly.

lsblk

Then run the following command. Replace /dev/sdb with the actual block device name of your flash drive.

sudo f3probe --destructive --time-ops /dev/sdb

f3probe-fake-usb-test

If the usable size equals announced size, then your USB drive is not fake. Otherwise you should ask for your money back.

That’s it! I hope this tutorial helped you verify USB capacity in Linux. As always, if you found this post useful, then please subscribe to our free newsletter or follow us on Google+Twitter or like our Facebook page. Thanks for visiting!

Rate this tutorial
[Total: 4 Average: 4.3]