1<table width="100%"> 2<tbody> 3<tr> 4<td width="33%"><a href="../dk-eradisk/" title="dk-eradisk">← Previous</a></td> 5<td><a href="../Home/#programs" title="Programs table of contents">↑ Programs TOC</a></td> 6<td width="33%"><a href="../dk-hex/" title="dk-hex">→ Next</a></td> 7</tr> 8</tbody> 9</table> 10 11 12# dk-eradisk — Create data stream to erase a disk 13 14[TOC] 15 16<a name="synopsis" id="synopsis"></a> 17## Synopsis 18 19~~~ 20dk-eradisk [_options_] 21~~~ 22 23--- 24 25<a name="description" id="description"></a> 26## Description 27 28The program generates a data stream to erase a disk. Before retiring a disk or handing a disk over to another user one should remove all contents. 29The output from dk-eradisk can be used as input for the dd program to safely clean a disk. 30 31--- 32 33<a name="options" id="options"></a> 34## Options 35 36Option|Purpose 37------|------- 38-p _number_<br>--pass=_number_|Pass number. The pass number chooses bit bit pattern, 0x00, 0xFF, 0x0F, 0xF0, 0x33, 0xCC, 0x55, or 0xAA.<br>When doing multiple passes, start with the highest pass number and use pass number 0 for the final pass. 39-b _size_<br>--blocksize=_size_|Block size (default: 4096=4K). The default is suitable for traditional hard disks. For flash memory (i.e. SSD) you should increase the value to 1M. 40-c _size_<br>--count=_size_|Number of blocks to write. The default 0 creates an endless sequence of blocks until the program is finished by signal. 41 42--- 43 44<a name="exitstatus" id="exitstatus"></a> 45## Exit status 46 470 on success, all other status codes indicate an error. 48 49--- 50 51<a name="notes" id="notes"></a> 52## Notes 53 54This program uses DK libraries version 4. 55 56--- 57 58<a name="examples" id="examples"></a> 59## Examples 60 61### Erase a disk 62 63To erase a disk: 64 65~~~ 66dk-eradisk -b 1M | dd of=/dev/sda bs=1M conv=fdatasync 67~~~ 68 69Program|Option|Purpose 70-------|------|------- 71dk-eradisk||Create stream containing patterns to overwrite a disk. 72|-b 1M|Block size is 1 Mibibyte (1048576 bytes). 73dd||Apply data stream to disk. 74|of=/dev/sda|Destination disk to overwrite. 75|bs=1M|Block size is 1 Mibibyte. 76|conv=fdatasync|Flush output buffer at end. 77 78### Erase a disk in multiple passes 79 80To erase a disk in multiple passes (to deny restoring any contents): 81 82~~~ 83for i in 7 6 5 4 3 2 1 0 84do 85 dk-eradisk -p $i -b 1M | dd of=/dev/sda bs=1M conv=fdatasync 86done 87~~~ 88 89--- 90 91<a name="author" id="author"></a> 92## Author 93 94Dirk Krause 95 96<table width="100%"> 97<tbody> 98<tr> 99<td width="33%"><a href="../dk-eradisk/" title="dk-eradisk">← Previous</a></td> 100<td><a href="../Home/#programs" title="Programs table of contents">↑ Programs TOC</a></td> 101<td width="33%"><a href="../dk-hex/" title="dk-hex">→ Next</a></td> 102</tr> 103</tbody> 104</table> 105 106