Bad sector, Badblocks, badsectors, check disk for errors, checkdisk, Device file, disk

Bad Blocks

sudo badblocks -v /dev/sdc1

Checking blocks 0 to 130954239
Checking for bad blocks (read-only test): 5621828 done, 3:37 elapsed
5621860 done, 8:43 elapsed
5621861 done, 13:25 elapsed
5621862 done, 17:57 elapsed
done
Pass completed, 4 bad blocks found.

Write bad sectors into a file

sudo badblocks /dev/sdc > /home/hacks/bad-blocks

Mark bad sectors as ‘unusable’

sudo fsck -l bad-blocks /dev/sdc

Test Hard Disk Read Speed Using «dd»

# dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 14.1893 s, 75.7 MB/s

Disk IO test

# Prepare the test
sysbench --test=fileio --file-total-size=5G prepare > /dev/null

# Sequential Write
sysbench --test=fileio --file-total-size=5G --file-test-mode=seqwr --max-time=120 --max-requests=0 run

#Sequential Rewrite
sysbench --test=fileio --file-total-size=5G --file-test-mode=seqrewr --max-time=120 --max-requests=0 run

#Sequential Read
sysbench --test=fileio --file-total-size=5G --file-test-mode=seqrd --max-time=120 --max-requests=0 run

#Random Read
sysbench --test=fileio --file-total-size=5G --file-test-mode=rndrd --max-time=120 --max-requests=0 run

#Random Write
sysbench --test=fileio --file-total-size=5G --file-test-mode=rndwr --max-time=120 --max-requests=0 run

#Combined Random Read/Write
sysbench --test=fileio --file-total-size=5G --file-test-mode=rndrw --max-time=120 --max-requests=0 run

#Clean the test
sysbench --test=fileio --file-total-size=5G cleanup

TesDisk.