How to corrupt a disk partition using dd
I wanted to test corruption of a 41TB XFS filesystem and the dd command was the perfect tool for the job.
I used a block size of 512 bytes and wrote 10 blocks of data from device /dev/urandom to the partition /dev/sdb1.
The “Seek” option specifies how many blocks are skipped, counting 100 blocks from the beginning of the partiton, before writing the random/corrupted data.
# dd bs=512 count=10 seek=100 if=/dev/urandom of=/dev/sdb1
This procedure WILL most likely corrupt your disk partition or files on the partition. Use it ONLY on test systems and with a valid backup!