title: How can a /dev/one be created on CentOS?
body: <p>I usually do the following on faulty hard-disks, before discarding them:</p>
  
  <pre><code># lsblk /dev/sdb
  NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
  sdb      8:16   0  2.7T  0 disk 
  └─sdb1   8:17   0  2.7T  0 part 
  # part=b
  # for disk in /dev/sd[$part] ; do  echo ${disk};  echo "zero" ;  dd if=/dev/zero | pv | dd of=${disk}1 bs=99M iflag=fullblock ;  echo "urandom" ;  dd if=/dev/urandom | pv | dd of=${disk}1 bs=99M iflag=fullblock ;  echo "one" ;  dd if=&lt;(yes $'\xFF' | tr -d '\n') | dd of=${disk}1 bs=99M iflag=fullblock  status=progress ;  done 
  </code></pre>
  
  <p>Which will write a <code>0</code>, a random <code>0</code>/<code>1</code>, and a <code>1</code> on each byte of the disk. That should be enough to erase the data, if those trying to recover it aren't the NSA or the Mossad.</p>
  
  <p>However, inputting <code>/dev/zero</code> and <code>/dev/urandom</code>, are <em>much</em> faster than <code>&lt;(yes $'\xFF' | tr -d '\n')</code>.</p>
  
  <p><strong>Is there a way to create a device on CentOS that will do for <code>1</code>, the equivalent that is done for <code>0</code> with <code>/dev/zero</code>?</strong></p>
  
  <h2>Edit:</h2>
  
  <p>A faster way of getting a stream of ones is <code>if=&lt;(cat /dev/zero | tr "\000" "\377")</code>, i.e.:</p>
  
  <pre><code>dd if=&lt;(cat /dev/zero | tr "\000" "\377") | dd of=${disk}1 bs=99M iflag=fullblock status=progress ;
  </code></pre>