Linux SSD health check
All of the SSDs these days offer a built-in monitoring protocol called SMART or Self-Monitoring, Analysis, and Reporting Technology. In order to tap into this, you will need to install:
apt install smartmontools
After the package is installed, you can check if the protocol is available on your device:
smartctl -i /dev/sdb
smartctl -i -a /dev/sdb
You can also run a short self-test like so:
smartctl -t short /dev/sdb
sh -c 'sleep 120 && smartctl -l selftest /dev/sdb'