Skip to main content

Initializing Solid State Drives (SSDs)

You must initialize SSDs before use, which means either trimming or zeroizing the drives. Newly-provisioned SSDs should be trimmed, and their headers (the initial 8 MiB) must be zeroized. Older devices containing Aerospike data should be entirely wiped (zeroized) before reuse. Initializing SSDs helps to ensure that old data, partitioning, and master boot records (MBR) do not interfere with new operations.

  • Trimming is fast, but not thorough. Trimming marks used blocks for deletion, and then the SSD and operating system manage deleting the old data.
  • Zeroizing take more time, as much as an hour per SSD. Zeroizing writes zeroes to every block on the drive.
  • You can initialize multiple SSDs in a single operation. Refer to How to zeroize multiple storage devices simultaneously?).

Trimming is sufficient for new SSDs.

Trimming SSDs

Most SSDs support TRIM. Many cloud services vendors also support TRIM. blkdiscard is included on most Linux distributions, in the util-linux package.

Trimming an SSD and erasing the header requires two steps. First trim the device:

blkdiscard /dev/DEVICE-ID

Then zeroize the Aerospike device header:

blkdiscard -z --length 8MiB /dev/DEVICE-ID

Zeroizing an SSD

Zeroizing an SSD may take an hour or more. This overwrites all blocks with zeroes:

blkdiscard -z /dev/DEVICE-ID