Are there any benefits, in terms of performance or security in ‘wiping’ or overwriting an SSD before reinstalling Linux? And if so, what is the best way of doing it?
I’m planning on doing a clean install of Debian 13 on my laptop soon.
I’m currently on Fedora and using encryption and will be using encryption on Debian too. I do not have a separate home partition.
Thanks :)
Are there any benefits, in terms of performance or security in ‘wiping’ or overwriting an SSD before reinstalling Linux?
No
If you use new encryption and not re-use the existing I’d say there is no advantage in wiping
There’s no performance improvement to wiping an SSD. At least not meaningfully, on a completely empty SSD that has been factory wiped. You may see a first time right improvement but that goes away as soon as the SSD starts doing garbage collection.
As for your other reasons, they’re completely up to you.
Security … Depends. If you want to sell the SSD, then yes, wiping the SSD is advised. You don’t need complicated random multiple-write patterns. Just make sure to wipe everything (keywords: wear-leveling, cache), you could use
blkdiscard
for that.Performance-wise nothing noticeable would change. Physically, SSDs are fast enough to modify the charge traps to store the bits as needed to store files regardless of what’s in those traps (that’s quite a rabbit hole).
If you plan using the SSD for your own, you don’t need to wipe it, just repartition as needed and create the file systems in the partitions. What I do, is writing some data to the storage to destroy the partition table (
dd if=/dev/urandom of=/dev/XYZ
whereXYZ
is my target device – and then leave it runninf for a few seconds).Since you’re using encryption, the common tools only see garbage and no data (i.e. file system). So simply don’t decrypt and work with the mapped partition but use the device directly.
If you are using encryption now, you do not need to wipe the SSD, after a new install the remaining data on the “disk” will still be encrypted, without the key.
Are there any benefits, in terms of performance or security in ‘wiping’ or overwriting an SSD before reinstalling Linux?
Yes, you remove the possibility of theoretically restoring the old data previously stored on the storage device.
And if so, what is the best way of doing it? I’m planning on doing a clean install of Debian 13
Select encrypted storage when partitioning, make sure you select the “Overwrite with random data” option.
I’m currently on Fedora and using encryption and will be using encryption on Debian too.
If it’s a full disk encryption on both current and future setup, there’s no benefit from overwriting.
I’ve heard that SSD have a relatively limited number of write cycles, and that wiping/compacting data can even be a slightly bad thing in this regard. I am not sure at all if this is true though, don’t take my word for it and correct me if i’m wrong.
It’s sort-of true. Write cycles are limited.
However most modern-ish SSDs have a secure-erase command which would allow clearing without actually re-writing each sector from the OS level. It’s also much faster.
There are utilities to do this: hdparm and blkdiscard
That said, there’s little reason to do this.
In my experience it’s also very very hard to wear out an SSD. It’s limited, but mostly the limit is very very far away. I treat those warnings as largely fud. Most common failure more seems to be that the controller in the drive dies for some reason and the drive just goes completely dead and never gets detected again. There won’t be warnings from any smart values either.
Or the drive is just replaced with a bigger faster one, maybe on a different bus/connector or something, and forgotten in a drawer or a box somewhere.
Naturally it’s still worth trying to enable trim and limit writes if there’s no downside. It can only help in case the drive does get an exceptionally long service life. But I’d say use it while it’s still useful and keep fresh and verified backups.