Wednesday | 28 FEB 2024
[ previous ]
[ next ]

Validating a USB

Title:
Date: 2024-02-04
Tags:  

After hearing all the stories about getting bad usbs with the wrong sizes, I figure it would be wise to check my usbs from now now.

Luckily it's quite simple.

On Linux, you can use the f3 tool to check the size of a usb.

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

This will print:

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/sda' is the real thing

Device geometry:
	        *Usable* size: 58.59 GB (122880000 blocks)
	       Announced size: 58.59 GB (122880000 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: 4'12"
 Operation: total time / count = avg time
      Read: 832.7ms / 4816 = 172us
     Write: 4'11" / 4192321 = 59us
     Reset: 0us / 1 = 0us

In this output, there is no issue with the usb.

If there was a size mismatch, the output will display the fix command.

...
sudo f3fix --last-sec=16477878 /dev/sdX
...