Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get an equivalent of /dev/one in Linux

Tags:

You can use

dd if=/dev/zero of=file count=1024 bs=1024  

to zero fill a file.

Instead of that I want to one fill a file. How do I do that?

There is no /dev/one file, so how can I simulate that effect via on bash shell?

like image 519
Ankur Agarwal Avatar asked Jun 05 '12 21:06

Ankur Agarwal


1 Answers

tr '\0' '\377' < /dev/zero | dd bs=64K of=/dev/sdx 

This should be much faster. Choose your blocksizes (or add counts) like you need at. Writing ones to a SSD-Disk till full with a blocksize of 99M gave me 350M/s write performance.

like image 61
monkeybus Avatar answered Sep 30 '22 12:09

monkeybus