|→||1.5 File and directory tools|
Create data stream to erase a disk or storage device
|Copyright and license|
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 savely clean a disk.
Note: The dd program is not from DK tools. On Linux/Unix systems the dd program is typically installed during system installation or available in the package management. A free (GPL licensed) dd program is available in the GNU core utilities (coreutils).
0 on success, all other values indicate errors.
This program uses DK libraries version 4.
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
dk-eradisk -b 1M | dd of=/dev/sda bs=1M conv=fdatasync
Note: For FLASH-based storage (i.e. SSD, SD cards, USB devices) we should use a block size equal to the devices erase block size or integer multiples of that size. So 1048576 bytes is a good choice for these devices. For traditional spinning disks a block size of 4K would be sufficient.
The program replaces the ``dkt erase-disk'' from DK tools 3.x.x.
See the Legal stuff page for copyright and license information.