DO READ THE REPLIES! MY ASSUMPTIONS MIGHT BE TOO SIMPLISTIC.
Some pessimistic reports emerged years ago that unpowered SSDs, especially enterprise types, lose data when left unpowered for long periods.
https://www.extremetech.com/computing/2 ... hout-power
TL;DR
To "refresh" data for optimum long term retention on SSD,
which MIGHT be lost especially if read only, especially on unpowered, cold, enterprise devices
1) do regular backups to other media (not discussed here)
2) check data integrity read-only (not discussed here)
3) on a fully unmounted drive, occasionally do a verbose, non-destructive badblocks check showing progress.
Code: Select all
sudo badblocks -vns [path to whole drive]
I suggest to do the refresh with badblocks.
https://wiki.archlinux.org/title/badblocks
"A non-destructive read-write test makes a backup of the original content of a sector before testing with a single random pattern and then restoring the content from the backup. This is a single pass test and is useful as a general maintenance test. "
https://linux.die.net/man/8/badblocks
"-n Use non-destructive read-write mode. By default only a non-destructive read-only test is done."
AFTER making sure data is ok with an integrity check, back it up elsewhere, then use badblocks - vns [path to whole drive] which will
- read each cell (by block)
- back up content in RAM
- write a random pattern to cell
- Read cell
- confirm read corresponds to write
- get original content from RAM
- write it back in the cell
- report if any block is bad.
End result would be verified data, backed up, and refreshed at cell level.
Better than rewriting in the file system as the process would refresh also data structures, journals, partitioning etc..
Risk should be more or less limited to the event of a power loss.
This would certainly burn one write out of the lifetime of the SSD. True, only rewriting files would eat much less than exactly 1 write per cell everywhere.
Any comments?