I'm planning on getting an NVMe for use to contain a swapfile to extend the RAM of my Linux system. Yes, I know this is a bad choice due to the finite number of writes an NVMe has in its lifetime, but bear with me.
I'm wondering if an NVMe with ECC can detect and correct drive errors and redistribute the corrected data to some other section of the NVMe, doing this in the NVMe's firmware at runtime. This would slightly prolong the NVMe's lifetime, enough for me to use it for my purposes.
It speaks here about bad sectors and reallocation.
So does an NVMe correct errors and redistribute the data to good sections of the NVMe in firmware at runtime? If not then how is this done in the (Linux) OS?