Should I erase or keep files for sake of longevity?

pinoy

Limp Gawd
Joined
Dec 8, 2010
Messages
447
Since erasing data is what wears out SSD and the controller also does its wear-levelling by rewriting and erasing data, is it better I don't erase my data even though I don't need it anymore?
 

pitingres

Limp Gawd
Joined
Jul 25, 2018
Messages
389
Erasing/deleting files only deletes the access path to the data; it doesn't physically erase every data block of the file. (That's why the TRIM function exists, to tell the SSD that blocks can be re-used without having to actually write to them.)
 

pinoy

Limp Gawd
Joined
Dec 8, 2010
Messages
447
Let's say I have a 10 GB SSD and filled it with 1 GB of data. As I understand it that 1 GB of data gets moved around the drive by the controller as part of its wear levelling mechanism. Which means the 1 GB data is copied elsewhere on the drive and then the original is deleted. My question is how often does it happen? If I don't ever add any more data does the controller continually copy and delete the 1 GB of data indefinitely.
 

D-EJ915

[H]ard|Gawd
Joined
Jan 31, 2003
Messages
1,739
The drives aren't going to just arbitrarily move data around that would wear the drive out much quicker than normal. If you don't want the data anymore just delete it and don't overthink it lol.
 

pitingres

Limp Gawd
Joined
Jul 25, 2018
Messages
389
No, the drive doesn’t copy data around. What it might do is relocate a block if some or all is rewritten, rather than rewriting in place. Data that’s written and isn’t changing stays in place.
 

philb2

[H]ard|Gawd
Joined
May 26, 2021
Messages
1,188
The drives aren't going to just arbitrarily move data around that would wear the drive out much quicker than normal. If you don't want the data anymore just delete it and don't overthink it lol.

Same for old programs and games.
 

Nenu

[H]ardened
Joined
Apr 28, 2007
Messages
20,289
Erasing/deleting files only deletes the access path to the data; it doesn't physically erase every data block of the file. (That's why the TRIM function exists, to tell the SSD that blocks can be re-used without having to actually write to them.)

I'm not sure you understand TRIMs function.
The OS/drive already know the cells can be used again once deleted, TRIM does not perform or help with this function.
TRIM is used to save time when writing to cells that were previously used.

When a file is deleted it is removed from the FAT but still exists, and the cells are marked for erasure by TRIM.
Once all empty space (that has already been TRIMmed) is used up the above space will be written to next, but it must be cleared first (because TRIM hasnt run yet) which slows down the write process.
This is the reason TRIM exists and is run in the background, to clear the marked deleted space 'in advance' of it being needed again.

TRIM happens regularly + automatically unless you manually disable it.
Once TRIM is run, any bits that were a 1 are changed to 0, erased, leaving completely blank cells.
** The TRIM operation performs part of the wear an SSD receives by blanking cells, the rest of the wear comes from next data written to it.
So by deleting data, unless TRIM is not available, those cells will be erased unless that space is needed very soon after the delete.


OP you have nothing to worry about, its a normal process.
Also, by not freeing space (cells) with TRIM, the wear averaging algorithms have a harder time preventing worse wear to the most worn cells because they have less of the drive to work with.
AND the drive will be in use for longer when writing, getting a lot hotter than it would otherwise. This can matter with PCIE 4.0 or 5.0 drives that transfer data a lot faster, or PCIE 3.0 or earlier drives without a heatsink.
Its best to let TRIM do its job in the background so cells are hopefully pre-wiped before a write starts.
 

pitingres

Limp Gawd
Joined
Jul 25, 2018
Messages
389
I'm not sure you understand TRIMs function.
The OS/drive already know the cells can be used again once deleted, TRIM does not perform or help with this function.
TRIM is used to save time when writing to cells that were previously used.

Yes, exactly. That is what I thought I was trying to convey. It's how the filesystem tells the drive which (FS) blocks are no longer relevant to the filesystem, and therefore can be re-written into without first erasing. Without TRIM, the drive has to assume that a write into what the drive thinks is an in-use (in-use from the drive perspective, not the FS perspective) block is a rewrite and it has to first erase the block. With TRIM, the FS tells the drive which blocks are not in-use by the FS and therefore the drive can mark them not in-use by the drive. This is important because the drive erase block size is typically larger than both the drive read/write block size and the FS block size, so a rewrite of an FS block into what the drive thinks is an in-use block turns into a read-erase-modify-write operation.
 
Top