Articles in this section

How to zeroize multiple storage devices simultaneously?

Context

Customer may need to  dd (erase) multiple disk on a server. This can occur when initializing a system configured for multiple storage-engine devices (ssd, nvmes, raw disk partitions) .

Method

If your disks support blkdiscard (most SSDs or non Cloud environments), you should use that instead. blkdiscard instructs the SSD disk to discard blocks and treat them as unused/zeroed. This results in an operation that takes a few seconds only and removes the need to DD the disks.

    blkdiscard /dev/sdb
    blkdiscard /dev/sdc
    ...

Or in a loop:

 for i in sdb sdc sdd sde ; do blkdiscard /dev/"${i}" ; done
 Command line example to zeroize sdb, sdc, sdd, and sde at the same time using dd:

  dd if=/dev/zero bs=128k | tee /dev/sdb | tee /dev/sdc | tee /dev/sde > /dev/sdd

Applies To Earliest Version

Pre 4.9

Applies To Latest Version

Current Version
Was this article helpful?
0 out of 0 found this helpful