Domanda

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?

È stato utile?

Soluzione

How about this:

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

Substitute with character of your choice.

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top