Articles in this section

How to decide if blkdiscard is preferable to dd?

Context

In some circumstances it may be necessary to remove all data from an SSD drive used by Aerospike. There are multiple methods of doing this, two of the most common being dd and blkdiscard. Which is better to use in what circumstances?

Method

The dd approach will mark all sectors on the SSD as 'used' as it writes zeros across the disk. This interferes with the ability of the SSD to perform sector reallocations, native trim and wear levelling, as all sectors are now deemed occupied. blkdiscard on an SSD only marks the sectors as unused so that they are treated as all zeros. For this reason, blkdiscard is preferred in most cases. However, on AWS instances, blkdiscard instead performs an OPAL rotation on the data, which leaves it with garbage data. In this case, dd is the better option.

Notes

* "blkdiscard -z" is actually equivalent to the dd command
* Please see the device initialization page for details.
 

Applies To Earliest Version

Pre 4.9

Applies To Latest Version

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