3 ms·
Slightly related: I have a tool that writes random (incompressible) data to a disk and lets you verify it back without storing a copy (by using a csprng seed),
by ComputerGuru 7mo ago
Slightly related: I have a tool that writes random (incompressible) data to a disk and lets you verify it back without storing a copy (by using a csprng seed), initially developed for benchmarking SSDs that used to cheat to get better performance numbers but that can also be used for this purpose or to overwrite (“shred”) a disk: https://github.com/mqudsi/hddrand https://github.com/mqudsi/hddrand
- fhdkweig 7mo agoI haven't used badblocks https://en.wikipedia.org/wiki/Badblocks https://en.wikipedia.org/wiki/Badblocks in about 10 years, but I was annoyed that this exact feature wasn't available for testing accidental swapping of block locations. badblocks only writes the same data to each block and thus they are all indistinguishable.
- champtar 7mo agoTIL `badblocks -t random` repeats the same random block over and over :(
- jmb99 7mo agoYou can however set the block size to something quite large, which means you write the same random pattern spread out over multiple blocks repeatedly. If you pick an "odd" block size (like say, your native block size multiplied by 47), it's highly unlikely your disk under test will be swapping around "groups of 47 blocks." (I usually just do a nice multiple, like 4K16, but if you're super paranoid a weird multiple should be pretty much good enough). You won't get reporting of which exact* blocks on the drive are failing, but these days, that isn't really useful information - if any blocks are failing, warranty or ditch the drive.
- Superfud 7mo agoddrescue can read from /dev/urandom and write to any device. This can come in handy when you have a device with bad blocks but still would like to "shred" all the still writable parts of.
- NooneAtAll3 7mo agothere's no point in writing actual random data - you won't be able to check correctness without another copy
- foresto 7mo agoSee also: F3 https://fight-flash-fraud.readthedocs.io/en/stable/ https://fight-flash-fraud.readthedocs.io/en/stable/