Menu

dk-eradisk

Dirk Krause
← Previous ↑ Home ↑ Programs → Next

dk-eradisk — Generate data stream to erase disk / partition

Description

The 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.
The output from dk-eradisk can be used as input for the dd program to safely clean a disk.


Examples

Erase a disk

To erase a disk:

dk-eradisk -b 1M | dd of=/dev/sda bs=1M conv=fdatasync
Program Option Purpose
dk-eradisk Create stream containing patterns to overwrite a disk.
-b 1M Block size is 1 Mibibyte (1048576 bytes).
dd Apply data stream to disk.
of=/dev/sda Destination disk to overwrite.
bs=1M Block size is 1 Mibibyte.
conv=fdatasync Flush output buffer at end.

The "-b 1M" option for dk-eradisk must correspond to the "bs=1M" option for dd.

Erase a disk in multiple passes

To erase a disk in multiple passes (to deny restoring any contents):

for i in 7 6 5 4 3 2 1 0
do
  dk-eradisk -p $i -b 1M | dd of=/dev/sda bs=1M conv=fdatasync
done

Manual

See the [dk-eradisk manual] for the full documentation of the program.


← Previous ↑ Home ↑ Programs → Next

Related

Wiki: Home
Wiki: dk-eradisk manual

MongoDB Logo MongoDB