[HowTo] test whether a USB-stick is a "fake"

Difficulty: ★★★☆☆

There are USB sticks and SD cards (and ssd) in circulation that are not of the specified size. Often you only notice this when you have lost data. But there is a way to test it. This is not laborious, but time-consuming!

  • Choose one of your USB sticks with USB2 or 3 (A 64GB USB stick is used in the examples below)

  • Install the f3 package from the AUR:

    pamac install f3
    
test the USB stick for the real size:

Insert the USB stick and see what kind of device ID it got. The easiest tool to use is: lsblk:

lsblk
NAME        MAJ:MIN RM    SIZE RO TYPE MOUNTPOINT
sda           8:0    0  931,5G  0 disk 
├─sda1        8:1    0    953M  0 part /boot/efi
├─sda2        8:2    0    900G  0 part /var/spool
└─sda3        8:3    0   28,1G  0 part 
sdb           8:16   0  476,9G  0 disk 
├─sdb1        8:17   0    512M  0 part 
└─sdb2        8:18   0  476,4G  0 part 
sdz           8:32   1   59,5G  0 disk 
nvme0n1     259:0    0    1,9T  0 disk 
├─nvme0n1p1 259:1    0      1G  0 part 
├─nvme0n1p2 259:2    0      1M  0 part 
├─nvme0n1p3 259:3    0    900G  0 part 
└─nvme0n1p4 259:4    0 1006,7G  0 part 

:warning: PLEASE check again that /dev/sdz is really your USB stick and not part of your Manjaro system.

  • Safely remove the device
  • Unplug
  • Plug it back in
  • Test with lsblk again!

The USB stick must have disappeared from the list!

  • Safely remove the device
  • Unplug
  • Plug it back in
  • Test with lsblk again!

The device should have reappeared. If you are not sure then stop here: If you enter the wrong device with the next command, you will wreck your whole system with one command !

Those who checked well can now test the USB stick. The USB stick will be deleted !!! (So save data that you still need beforehand)

sudo f3probe --destructive --time-ops /dev/sdz                                                                                              
F3 probe 8.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.

Good news: The device `/dev/sdz' is the real thing

Device geometry:
	         *Usable* size: 59.53 GB (124846080 blocks)
	        Announced size: 59.53 GB (124846080 blocks)
	                Module: 64.00 GB (2^36 Bytes)
	Approximate cache size: 0.00 Byte (0 blocks), need-reset=no
	   Physical block size: 512.00 Byte (2^9 Bytes)

Probe time: 3'53"
 Operation: total time / count = avg time
      Read: 5.39s / 4816 = 1.1ms
     Write: 3'46" / 4192321 = 54us
     Reset: 0us / 1 = 0us

I hope your stick is as good as mine
Good news: The device ‘/dev/sdz’ is the real thing
And the Usable size: 59.53 GB (124846080 blocks) is as advertised

Test the stick for data security and speed
  • Use gparted to format the stick as a single partition with exfat (about 59GiB) and name “test”. The USB stick will be deleted !!! (So save data that you still need beforehand)
  • unplug,
  • plug in,
  • Mount the USB sick (the stick now is empty)
    For me, the stick ends up in /run/media/andreas/test/. You have to adapt this to your mount point.
    Now we fill the stick completely with data.

Warning:
:warning: This takes a really long time. For me it was about 2 hours with USB2 and 64 GB
:warning: Writing the stick this way will shorten the life of your USB stick through wear leveling, so don’t do it to often.

f3write /run/media/andreas/test
F3 write 8.0
Copyright (C) 2010 Digirati Internet LTDA.
This is free software; see the source for copying conditions.

Free space: 59.53 GB
Creating file 1.h2w ... OK!                           
Creating file 2.h2w ... OK!    
...
Creating file 59.h2w ... OK!                         
Creating file 60.h2w ... OK!                        
Free space: 0.00 Byte
Average writing speed: 7.75 MB/s

Now we just have to read the data again and compare. Warning: it takes a really long time. :warning: With USB2 and 64 GB it was also almost 2 hours.

f3read /run/media/andreas/test                                                                                                                            
F3 read 8.0
Copyright (C) 2010 Digirati Internet LTDA.
This is free software; see the source for copying conditions.

                  SECTORS      ok/corrupted/changed/overwritten
Validating file 1.h2w ... 2097152/        0/      0/      0
Validating file 2.h2w ... 2097152/        0/      0/      0
Validating file 3.h2w ... 2097152/        0/      0/      0
Validating file 4.h2w ... 2097152/        0/      0/      0
...
Validating file 58.h2w ... 2097152/        0/      0/      0
Validating file 59.h2w ... 2097152/        0/      0/      0
Validating file 60.h2w ... 1103104/        0/      0/      0

  Data OK: 59.53 GB (124835072 sectors)
Data LOST: 0.00 Byte (0 sectors)
	       Corrupted: 0.00 Byte (0 sectors)
	Slightly changed: 0.00 Byte (0 sectors)
	     Overwritten: 0.00 Byte (0 sectors)
Average reading speed: 12.48 MB/s

I hope your stick is as good as mine
Data LOST: 0.00 bytes (0 sectors)

Note: The full instructions for f3 can be found here

  • my USB-stick was good
  • my USB-stick had errors
  • my USB-stick is a fake (much smaller then advertised)

0 voters

1 Like