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.

Booting ISO Files Without a USB stick

Ever wondered if you can boot Linux and Windows ISO files without creating a live USB or live CD? Yes, you can. Please read the following tutorial:

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 Twitter or like our Facebook page. Thanks for visiting!

Rate this tutorial
[Total: 29 Average: 4.7]

12 Responses to “How to Check Real USB Capacity in Linux Terminal

  • Ignacio T.
    5 years ago

    Thanks a lot

  • Will Noble
    5 years ago

    Hi
    Mt grateful thanks for the use of your software. I’m no technowhizz but I followed it carefully and got the check done. I’d become concerned about 2 x 128Gb Samsung EVO Plus microSDXC class 10 cards. They showed ALL of the features that others said indicated a fake, ie, black card edges – not white, packaging slots not fully punched through, made in Korea – not the Philippines, not in truly tamper-proof packs, generic, non-Samsung SD adapters, etc.
    They checked out at 116Gb each, passed the read/write test at that figure except for one with a loss of 16.32 Mb, at roughly 16Mb/sec on a bog standard USB2 OTG adapter into my laptop.
    F3 probe also declares them a pass and ‘the real thing’ but the thing I am suspicious of is the capacity. Should it not be nearer 128Mb? If it makes any odds, they were FAT32 formatted by G-Parted.
    Regards
    Will

  • Les Wilkinson
    4 years ago

    I just stumbled upon your software and I am so glad that I did I have not been using Linux for long so I guess I am a newbie I purchased two supposedly 2TB USB flash drives on ebay but became suspicious that they where not what they calmed to be and as I say I found your software and it was so easy to use it confirmed that my USB drives are only 1TB and not 2TB as stated using your evidence (I sent them a copy of my terminal results ) I contacted the seller and was reimbursed my purchase money and told me to keep the USB Drives

    many thanks for this software I

  • Could I suggest you change the reference in the code from `/dev/sdb` to `/dev/sdx`.

    Newbies might cut and paste `sudo f3probe –destructive –time-ops /dev/sdb`, and due to the –destuctive flag, will probably trash their second drive.

    • Blueswerks
      3 years ago

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

      lsblk

  • Not really sold on this utility as an alternative to h2testw. It takes about 6min to write one of its 1GB test files to a Lexar 128GB Cl 10 thumb drive on a USB 3.0 port on a Lenovo x220 laptop @2.86MB/s. But I can copy a 1G video file to the the drive in about 8-10 secs.

    Anybody know what to make of this?

    Thanks!

    • Usually when you copy files to a flash drive it buffers it in memory before committing it to disk which makes it seems to be faster. If you pull out the drive before it actually saves it to the disk, then the actual file on the disk may become corrupt.

      Before removing a drive in linux you should umount it which should commit the file to the disk, other than that you can use the sync command. In windows you would normally eject the USB device. You will notice this when you are in a hurry trying to copy a large file for a friend on a USB drive, they see it is done and the just pull the drive without a proper eject. Or when you do a proper eject, it takes a while.

  • mechamatze
    3 years ago

    THX, for this tutorial, i use it to check sticks and ssd’s i ordered from WISH. If you want an USB stick for free order 2TB sticks from wish for 5 – 10 €, use this tutorial, kontakt wish support and send them a picture from the output of fprobe. Get your money Back….. Have fun.

  • Blueswerks
    3 years ago

    Thought I would try f3write with my new USB 3.0, but received error: Creating file 1.h2w … 0.43% — 48.00 MB/s — 8378:44:31f3write: f3write.c:241: measure: Assertion `!fdatasync(fd)’ failed.
    But, USB 2.0 works great! Just sharing in case someone else may have this issue and a possible solution. Great software.

  • Blueswerks
    2 years ago

    I am receiving the following error checking 128GB PNY microSD. Bad microSD card?

    ~~~~~~~~~~~~~~

    f3probe –destructive –time-ops /dev/sdc
    F3 probe 6.0
    Copyright (C) 2010 Digirati Internet LTDA.
    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.

    f3probe: libdevs.c:416: read_all: Assertion `(*__errno_location ()) == 5′ failed.
    Aborted (core dumped)

  • Hello All, if you are tyring to install f3 but failing to do so type this

    sudo add-apt-repository universe multiverse
    then run
    sudo apt update

    then try to install

  • The Pooch
    1 month ago

    I am trying to use f3write but I am always receiving the following error:

    f3write: Wrong number of arguments; only one is allowed
    Try `f3write –help’ or `f3write –usage’ for more information.

    HEEEEEEEEEEEEEEEEEEEEEELP!!!

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here