Other How to mark all blocks in an SSD as free / unused

I have a used Kingston SSD sata drive that I want to use with a USB to SATA converter.

Since this converter does not pass TRIM command, I want to leave 20% of unused blocks free, excluded from the partition.

Then, I need to mark all blocks as free / unused before doing the partition.

Of course I asked AI, but I want to know what real people really do.

Any hint?
 
Im not quite sure what exactly you are trying to do and why. I'm guessing you want to let 20% free for overprovisioning.

I second what covacat said, I don't do really much. Just erase the disk and decide for partitioning the way you leave 20% unpartitioned-free.

Using camcontrol you can reset a SSD way quicker, and with less fewer write cycles to factory default aka erase it, instead of using dd:
%camcontrol security ada4 to get the drive's password "pwd" (something like "eeef".) Of course you need to replace "ada4" by your correct drive's name.
%camcontrol security ada4 -U user -s pwd to activate the drive's security ("-U user" literally, if not set otherwise)
then either
%camcontrol security ada4 -U user -e pwd to simply erase the drive (lasts less than a few seconds)
or
%camcontrol security ada4 -U user -h pwd for enhanced erase (may last a few minutes)

After every action the drive's security is set automatically again. The second step with -s needs to be done before every action.
see the manual pages Archive camcontrol(8)

(learned that without AI, just by reading manpages 😁:cool:)
 
just hook it to an internal sata connector, boot from usb and use trim(8)

it looks like with trim(8) you can trim entire disk or a partition
 
Understand that you have ZERO control over the flash memory on an SSD device. The controller does magic to deal with things like wear leveling and fragmentation, all behind the scenes. Just format and use it as a regular device. Even doing things like disabling access time updates is often considered passe these days since SSD from reputable manufacturers last a long time and support many many writes.

And if you are worried about filesystem access time as things become fragmented, well don't. there is negligable seek/rotational delay in accessing flash memory.

If anything, it is unnecessary to "zero out" previous data because you are virtually guranteed that you are NOT in fact zeroning anything, but instead filling another block with zeros and the controller is logically mapping that new block into addressable space.
 
Use Kingston SSD Manager to TRIM/erase entire disk, then make partitions and format.
For that is MS Windows necessary. I did what Maturin said, and it seems I was successful.
Good to know a generic method not dependent on the vendor.
 
Using camcontrol you can reset a SSD way quicker, and with less fewer write cycles to factory default aka erase it, instead of using dd:
%camcontrol security ada4 to get the drive's password "pwd" (something like "eeef".) Of course you need to replace "ada4" by your correct drive's name.
%camcontrol security ada4 -U user -s pwd to activate the drive's security ("-U user" literally, if not set otherwise)
then either
How widely supported are these security features? I'm wondering why I've never seen anyone suggest having internal device encryption under ZFS, instead of geli.
 
Back
Top