badblocks -c 10240 -wsvt random /dev/<drive>

https://wiki.archlinux.org/index.php/Badblocks

https://wiki.archlinux.org/index.php/System_Encryption_with_LUKS