Which is actually pretty much exactly the same as what happens with
spinning rust.
The primary aim of a hard drive - SSD or spinning rust - is to save the
user's data. If the drive can't read the data it will do nothing save
returning a read error. Think about it - any other action will simply
make matters worse, namely the drive is actively destroying
possibly-salvageable data.
All being well, the user has raid or backups, and will be able to
re-write the file, at which point the drive will attempt recovery, as it
now has KNOWN GOOD data. If the write fails, the block will then be
added to the *drive internal* badblock list, and will be remapped elsewhere.
MODERN DRIVES SHOULD NEVER HAVE AN OS-LEVEL BADBLOCKS LIST. If they do,
something is seriously wrong, because the drive should be hiding it from
the OS.
>
> The general advice is to avoid powering down an SSD which is suspected of
> corruption, until all the data is copied/recovered off it first. If you power
> it down, data on it may never be accessible again without the aforementioned
> lab.
Seriously, this is EXTREMELY GOOD advice. I don't know whether it is
still true, but there have been plenty of stories in the past about
SSDs, when they get too many errors, they self-destruct on power-down!!!
This imho is a serious design fault - you can't recover data from an SSD
that won't boot - but the fact is it appears to be a deliberate decision
by the manufacturers.
>
> BTW, running badblocks in read-write mode on an ailing/aged SSD may exacerbate
> the problem without much benefit by accelerating wear and causing additional
> cells to fail. At the same time you could be relying on the suspect disk
> firmware to access via its virtual map the data on some of its cells. Data
> scrubbing (btrfs, zfs) and recent backups would probably be a better strategy
> with SSDs.
>
Yup. If you suspect badblocks have damaged your data, you need backups
or raid. And then don't worry about it - apart from making sure your
drives look healthy and replacing any that are dodgy.
Just make sure you interpret smartmontools data correctly - perfectly
healthy drives can drop dead for no apparent reason, and drives that
look at death's door will carry on for ever. In particular, read errors
aren't serious unless they are accompanied by a growing number of
relocation errors. If the relocation number jumps, watch it. If it
doesn't move while you're watching, it was probably a glitch and the
drive is okay. But use your head and be sensible. Any sign of regular
failed writes, BIN THE DRIVE.
(I think my 8TB drive says 1 read error per less-than-two end-to-end
scans is well within spec...)
Cheers,
Wol