On 2023-10-26 14:47, Andrei Borzenkov wrote:
On Thu, Oct 26, 2023 at 1:47 PM Carlos E. R.
wrote: The remapping table would be just one number per sector, but one full rewrite of the table each time a sector in the disk changes (or maybe not, it is several sectors in size). I thought that would be too much wear. And the table itself would be subject to remapping? Then how can the firmware find it?
It could use self-identifying flash format and scan it on power-on to build the translation table. Translation table itself would be kept in RAM to speed up access. This would mean overhead of one block per erase page but no extra writes.
That's what I thought initially, ram. But at some point, it has to be written to some permanent storage. I suppose periodically. Can the media keep enough charge in capacitors to back up the last changes when power fails suddenly? For instance, running "smartctl -a /dev/nvme0n1", one of the lines I noticed says: Power Cycles: 398 Power On Hours: 2,321 Unsafe Shutdowns: 47 So "hard" poweroff can be dangerous, cause some kind of corruption, perhaps. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.5 (Laicolasse))