Filling a drive with /dev/urandom
seems to be very slow, so I created a file filled with FF
:
dd if=/dev/zero ibs=1k count=1000 | tr "\000" "\377" >ff.bin
I'd like to fill the drive with copies of this file but the following command only writes once:
dd if=ff.bin of=/dev/sdb count=10000
How do I fill the drive with copies of the file, or is there a faster way to fill the drive with 1's?
dd
has a the optionseek=N skip N obs-sized blocks at start of output
, so you can write a loop to seek to the correct placek*M
on the output block device before repeating a write of the M-sized file. – David Tonhofer Apr 20 '19 at 13:50