linuxddblock-device

How to use dd to fill a disk with a specific char?


I know i can fill an entire disk with 0x0 like this:

dd if=/dev/zero of=/dev/sda bs=4k conv=notrunc

Is there a way to fill the entire disk with a char of my choice?


Solution

  • How about this:

    yes "<char>" | dd of=/dev/sda bs=4k conv=notrunc
    

    Substitute with character of your choice.