Background: I'm vaguely thinking (maybe not very seriously) of writing my own
tester for things like SD/TF cards and flash drives to confirm the capacity.
The approach I'm thinking of would be something like this (assume a 256 GB
card for an example).
I'm thinking of writing a small number of 512 byte (one block) files in each GB
of the drive, at similar intervals in each GB (i.e., if I write the first block
in the first GB at an offset of say 100,000 blocks (a GB is 2,000,000 blocks),
I'd write that file for the next GB at 2,100,000 blocks, the next at 4,100,000,
and so on up to 254,100,000 blocks for the last GB).
I'd write a few blocks in each GB, and I'd "serialize" each file to be written
with the block number it is written at.
I'm thinking that dd could do the job, but it might be very slow. (according
to man the suffix for things like blocks can be M, G, T... (for mega, giga,
tera, ...), but if I ask dd to seek to the 254,100,000th block how long might
that take -- can dd somehow calculate where that block is and jump to it or
must it sort of serially work its way from block 1 to that 254,100,000th
block?
PS: I imagine that this would be done on the "raw device" (i.e., with no
filesystem) rather than on a filesystem (or file) on the device.
(Further, as I see it now, I'd have to invoke dd once for each block that it
writes or reads.)
Other thoughts are welcome, including things like pointers to a list where
things like this might be discussed.