Question

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?

Était-ce utile?

La solution

How about this:

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

Substitute with character of your choice.

Autres conseils

You can do it this way:

while true; do echo -n 'x'; done | dd of=/dev/sda bs=4k conv=notrunc iflag=fullblock
yes "" | tr "\n" "<char>" | dd of=/dev/sda <rest of dd parameters>
cat /dev/zero | tr "\0" "<char>" | dd of=/dev/sda <rest of dd parameters>
cat /dev/zero | sed "y/\0x00/<char>/" | dd of=/dev/sda <rest of dd parameters>

Where <char> is your chosen character

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top