Advertisements

Testing USB Memory Devices

Tantris recommended the f3 set of programs to verify USB memory devices, which certainly seemed as though it would be faster and much less labor-intensive than my low-tech manual method.

Compiling it from source required installing two dependencies, which I discovered by the simple expedient of iteratively smashing into “fatal error: parted/parted.h: No such file or directory” messages:

  • libudev-dev
  • libparted0-dev

With those in place, unleashing f3probe on the most recent replacement Sony 64 GB MicroSD card went swimmingly:

sudo ./f3probe --time-ops /dev/sdb
F3 probe 5.0
Copyright (C) 2010 Digirati Internet LTDA.
This is free software; see the source for copying conditions.
Please unplug and plug back the USB drive. Waiting... Thanks
Please unplug and plug back the USB drive. Waiting... Thanks
Please unplug and plug back the USB drive. Waiting... Thanks
Please unplug and plug back the USB drive. Waiting... Thanks
Please unplug and plug back the USB drive. Waiting... Thanks
Please unplug and plug back the USB drive. Waiting... Thanks
CAUTION		CAUTION		CAUTION
No more resets are needed, so do not unplug the drive
Probe finished, recovering blocks... Done

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

Device geometry:
	        *Real* size: 60.37 GB (126613504 blocks)
	     Announced size: 60.37 GB (126613504 blocks)
	             Module: 64.00 GB (2^36 Bytes)
	Physical block size: 512.00 Byte (2^9 Bytes)

Probe time: 61.19 seconds
Probe read op: count=775, total time=4.00s, avg op time=5.16ms
Probe write op: count=753, total time=3.77s, avg op time=5.00ms
Probe reset op: count=6, total time=53.42s, avg op time=8903.21ms

As predicted, most of the time passed while I fiddled with the SD Card adapter in the slot on the side of the U2711 monitor: push to release, push to insert, repeat as prompted.

Despite the f3fix program’s ability to “repair” counterfeit USB memory by resetting the partition to the actual capacity, I think that’s a Bad Idea. Based on my admittedly limited experience, counterfeit junk generally doesn’t come from the middle of the quality-control bell curve, so expecting that crap to actually work over the long term seems, shall we say, overconfident.

The f3 doc also told me about lsblk, which may come in handy every now & again:

lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 111.8G  0 disk 
├─sda1   8:1    0  56.8G  0 part /
└─sda2   8:2    0   9.3G  0 part [SWAP]
sdb      8:16   1  60.4G  0 disk 
└─sdb1   8:17   1  60.4G  0 part /media/ed/9C33-6BBD
sr0     11:0    1  1024M  0 rom 

Now I have a reminder of how to do this for The Next Time…

Advertisements

  1. #1 by Red County Pete on 2015-08-12 - 11:34

    simple expedient

    I’ve been going through the same exercise with the source for the Rosegarden MIDI program. Of course, the fun* part is figuring out what package the missing file comes from. I think I have everything, once I get the time to play with it…

    Once I get RG to compile, then I need to wander into the weeds of a realtime kernel if I really want it to work properly.

    depending on your definition of “fun”.