3 ms·
I 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 fe
by fhdkweig 8mo ago
I 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 8mo agoTIL `badblocks -t random` repeats the same random block over and over :(
- jmb99 8mo 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 8mo 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 8mo agothere's no point in writing actual random data - you won't be able to check correctness without another copy