Frequently Asked Questions

Kingston SSDs – Everything you need to know

Trim and garbage collection are technologies that modern SSDs incorporate to improve both their performance and endurance. When your SSD is fresh out of the box, all of the NAND blocks are empty so the SSD can write new data to the empty blocks in a single operation. Over time, most of the empty blocks will become used blocks that contain user data. In order to write new data to used blocks, the SSD is forced to perform a read-modify-write cycle. The read-modify-write cycle hurts the SSD's overall performance because it must now do three operations instead of a single operation. The read-modify-write cycle also causes write amplification, which hurts the SSD's overall endurance.

Trim and garbage collection can work together to improve SSD performance and endurance by freeing up used blocks. Garbage collection is a function built into the SSD controller that consolidates data stored in used blocks in order to free up more empty blocks. This process happens in the background and is completely handled by the SSD itself. However, the SSD may not know which blocks contain user data and which blocks contain stale data that the user has already deleted. This is where the trim function comes in. Trim allows the operating system to inform the SSD that data has been deleted so that the SSD can free up those previously used blocks. For trim to work, both the operating system and the SSD must support it. Most modern operating systems and SSDs support trim, although most RAID configurations do not.

Kingston SSDs take advantage of both garbage collection and trim technologies in order to maintain the highest possible performance and endurance over their lifetime.

FAQ: KSD-011411-GEN-13

More Questions

Secure Erase User Guide for Linux
This guide will walk you through securely erasing your Kingston SSD using Linux tools

SATA Secure Erase Procedure

Warning
Please make sure to have a full backup of any important data before you proceed!

Prerequisites
• You must have root privileges.
• You must have your SSD connected to the system as a secondary (non-OS) drive.
• You must have lsscsi and hdparm installed. You may need to install them with your distribution’s package manager.
• Your drive must not be in a security freeze.
• Your drive must not be password protected.

Instructions
1. Find the device name (/dev/sdX) of the drive you wish to erase:
# lsscsi

2. Make sure drive security is not frozen:
# hdparm -I /dev/sdX | grep frozen

If the output shows "frozen" (instead of "not frozen") then you cannot continue to the next step. You must try to remove the security freeze by trying one of the following methods:

Method 1: Put the system to sleep (suspend to RAM) and wake it up. On most distributions the command to suspend is:
# systemctl suspend

Now issue the hdparm command again. If it worked the output will show “not frozen” (instead of “frozen”).
Method 2: Hot plug the drive. This is done by physically unplugging the SATA power cable from the drive and plugging it back in while the system is powered on. You may need to enable hot plug in BIOS. Not all systems support hot plug.

Now issue the hdparm command again. If it worked the output will show “not frozen” (instead of “frozen”).

3. Set a user password on the drive. The password can be anything. Here we are setting the password to “p”:
# hdparm --security-set-pass p /dev/sdX

4. Issue the secure erase command to the drive using the same password:
# hdparm --security-erase p /dev/sdX

This command may take a few minutes to complete. The drive password is removed upon successful completion.
If the secure erase is interrupted or otherwise fails your drive may become security locked. In this case you can remove the security lock using the command below and then try the secure erase procedure again:
# hdparm --security-disable p /dev/sdX

SATA Secure Erase Example



NVMe Secure Erase Procedure

Warning
Please make sure to have a full backup of any important data before you proceed!

Prerequisites
• You must have root privileges.
• You must have your SSD connected to the system as a secondary (non-OS) drive.
• You must have nvme-cli installed. You may need to install it with your distribution’s package manager.
• Your drive must not be password protected.

Instructions
1. Find the device name (/dev/nvmeXn1) of the drive you wish to erase:
# nvme list

2. Issue the format command to the drive. Here we set the secure erase setting to 1 which indicates a user data erase:
# nvme format /dev/nvmeXn1 --ses=1

This command may take a few minutes to complete.


NVMe Secure Erase Example

FAQ: KSM-SE-LIX

Contact Technical Support

Questions about a Kingston product you already own? Ask a Kingston expert.

Call Technical Support

Monday-Friday 6 a.m.-6 p.m. PT

+1 (800)435-0640

Frequently Asked Questions

More Questions

Trim and garbage collection are technologies that modern SSDs incorporate to improve both their performance and endurance. When your SSD is fresh out of the box, all of the NAND blocks are empty so the SSD can write new data to the empty blocks in a single operation. Over time, most of the empty blocks will become used blocks that contain user data. In order to write new data to used blocks, the SSD is forced to perform a read-modify-write cycle. The read-modify-write cycle hurts the SSD's overall performance because it must now do three operations instead of a single operation. The read-modify-write cycle also causes write amplification, which hurts the SSD's overall endurance.

Trim and garbage collection can work together to improve SSD performance and endurance by freeing up used blocks. Garbage collection is a function built into the SSD controller that consolidates data stored in used blocks in order to free up more empty blocks. This process happens in the background and is completely handled by the SSD itself. However, the SSD may not know which blocks contain user data and which blocks contain stale data that the user has already deleted. This is where the trim function comes in. Trim allows the operating system to inform the SSD that data has been deleted so that the SSD can free up those previously used blocks. For trim to work, both the operating system and the SSD must support it. Most modern operating systems and SSDs support trim, although most RAID configurations do not.

Kingston SSDs take advantage of both garbage collection and trim technologies in order to maintain the highest possible performance and endurance over their lifetime.

FAQ: KSD-011411-GEN-13
Secure Erase User Guide for Linux
This guide will walk you through securely erasing your Kingston SSD using Linux tools

SATA Secure Erase Procedure

Warning
Please make sure to have a full backup of any important data before you proceed!

Prerequisites
• You must have root privileges.
• You must have your SSD connected to the system as a secondary (non-OS) drive.
• You must have lsscsi and hdparm installed. You may need to install them with your distribution’s package manager.
• Your drive must not be in a security freeze.
• Your drive must not be password protected.

Instructions
1. Find the device name (/dev/sdX) of the drive you wish to erase:
# lsscsi

2. Make sure drive security is not frozen:
# hdparm -I /dev/sdX | grep frozen

If the output shows "frozen" (instead of "not frozen") then you cannot continue to the next step. You must try to remove the security freeze by trying one of the following methods:

Method 1: Put the system to sleep (suspend to RAM) and wake it up. On most distributions the command to suspend is:
# systemctl suspend

Now issue the hdparm command again. If it worked the output will show “not frozen” (instead of “frozen”).
Method 2: Hot plug the drive. This is done by physically unplugging the SATA power cable from the drive and plugging it back in while the system is powered on. You may need to enable hot plug in BIOS. Not all systems support hot plug.

Now issue the hdparm command again. If it worked the output will show “not frozen” (instead of “frozen”).

3. Set a user password on the drive. The password can be anything. Here we are setting the password to “p”:
# hdparm --security-set-pass p /dev/sdX

4. Issue the secure erase command to the drive using the same password:
# hdparm --security-erase p /dev/sdX

This command may take a few minutes to complete. The drive password is removed upon successful completion.
If the secure erase is interrupted or otherwise fails your drive may become security locked. In this case you can remove the security lock using the command below and then try the secure erase procedure again:
# hdparm --security-disable p /dev/sdX

SATA Secure Erase Example



NVMe Secure Erase Procedure

Warning
Please make sure to have a full backup of any important data before you proceed!

Prerequisites
• You must have root privileges.
• You must have your SSD connected to the system as a secondary (non-OS) drive.
• You must have nvme-cli installed. You may need to install it with your distribution’s package manager.
• Your drive must not be password protected.

Instructions
1. Find the device name (/dev/nvmeXn1) of the drive you wish to erase:
# nvme list

2. Issue the format command to the drive. Here we set the secure erase setting to 1 which indicates a user data erase:
# nvme format /dev/nvmeXn1 --ses=1

This command may take a few minutes to complete.


NVMe Secure Erase Example

FAQ: KSM-SE-LIX

Contact Technical Support

Questions about a Kingston product you already own? Ask a Kingston expert.

Call Technical Support

Monday-Friday 6 a.m.-6 p.m. PT

+1 (800)435-0640

For information about how COVID-19 has affected our business operations, click here.

Keep in touch! Sign up to our emails for Kingston news and more.