How to check for actual USB capacity in Linux terminal
Ubuntu, Linux Mint, Elementary OS and Debian
sudo apt install f3
sudo dnf install f3
Use Gparted or Disk Manager to see the capacity of the Pen or Flash drive. Or use [c]lsblk[/c] on terminal
Testing for the Actual Capacity
**Replace [c]flash-drive-mount-point[/c] with the correct drive mount point
The above command will start writing on the drive with 1GB files named Nh2w when N is an number.
After the above task is finished use [c]f3read[/c] to read the files from the pen or flash drive
If the out put from f3read shows no corrupted sectors then the USB flash drive is good.
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.
As before use [c]lsblk[/c] to see the capacity and the block id for example [c]/dev/sdb[/c] [c]/dev/sdc[/c] [c]/dev/sdd [/c] /dev/sda in most cases will be the linux installation drive
sudo f3probe --destructive --time-ops /dev/block-id
**Replace block-id with the correct block id
The above command will test the drive and return an output showing the actual capacity and and announced capacity.
output when the usb is fake
This is free software; see the source for copying conditions. WARNING: Probing normally takes from a few seconds to 15 minutes, but it can take longer. Please be patient. Bad news: The device `/dev/sde' is a counterfeit of type limbo You can "fix" this device using the following command: f3fix --last-sec=253899 /dev/sde Device geometry: *Usable* size: 123.97 MB (253900 blocks) Announced size: 125.00 GB (262144000 blocks) Module: 128.00 GB (2^37 Bytes) Approximate cache size: 1.00 MB (2048 blocks), need-reset=no Physical block size: 512.00 Byte (2^9 Bytes) Probe time: 10.33s Operation: total time / count = avg time Read: 358.0ms / 4275 = 83us Write: 9.70s / 31073 = 312us Reset: 258.9ms / 1 = 258.9ms