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
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.
Close Gparted when it’s done.
Now back in your terminal, use
f3write command to let f3 write a file to your flash drive.
When writing to flash drive, f3write fills the filesystem with 1GB files named N.h2w, where N is a number (i.e. /[0-9]+/).
f3read command to check if the file can be read.
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.
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
Mine is /dev/sdb. Make sure you identified it correctly.
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
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!