# check hdd health

### check secor size
```bash
lsblk -o NAME,PHY-SeC
```
In my setup of SAS drives I have a block size of 512, my SATA drive setup has 4096 block size, with a block size of 512 I get the following error:
```bash
# badblocks -svw -b 512 -c 65536 /dev/sda
badblocks: Value too large for defined data type invalid end block (5860533168): must be 32-bit value
# badblocks -svw -b 512 -c 32768 /dev/sda
badblocks: Value too large for defined data type invalid end block (5860533168): must be 32-bit value
```
Increasing the block size to `4096` helped.
### badblocks
Check the health of a harddisk with [badblocks], attention the `w` option will delete all data on the disk. Use the blocksize from above with the [badblocks] command. 
```bash
badblocks -svw -b 4096 -c 400000 /dev/sda
```
It seems that the [c option] has a big impact on the runtime of [badblocks].
#### smart
After running [badblocks] you can run a long selftest
```bash
smartctl -t long /dev/sda
```

[badblocks]: http://e2fsprogs.sourceforge.net/
[c option]: https://superuser.com/questions/240641/how-long-does-badblocks-take-on-a-1tb-drive