In this tip, we will see how to use badblocks to scan/test your hard disk partitions (including USB hard drivers) for bad blocks (or bad sectors). Bad sectors are sectors that are damaged and cannot be used to store data on a hard drive. Badblocks will detect all bad blocks on your hard disk and store them in a text file so that you can use it with e2fsck to configure your OS to not store your data in these damaged sectors.
This tip can be run in the following Ubuntu/Linux Mint distributions:
- Ubuntu 12.10/12.04/11.10 or older
- Linux Mint 14/13/12 or older
WARNING: We are not liable for any mis-use of the commands given below. Use them at your own risk!