FAQ - When is blkdiscard preferable to dd?

The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.

FAQ - When is blkdiscard preferable to dd?

Detail

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?

Answer

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.

Keywords

DD BLKDISCARD ZERO SSD AWS OPAL ROTATION

Timestamp

March 2020