Translate badblocks result from 1024 block size to 4096 block size?
Solution 1:
You are correct that the default block size for badblocks
is 1024. From the documentation:
-b block_size
Specify the size of blocks in bytes. The default is 1024.
Your math is also correct. If you are using Ext4 with a default configuration, then your partitions are using 4KB blocks. So, if the 777th block had an error found, you can round down:
Floor((777 * 1024) / 4096) = 192
∴ Block 192
For the sake of completeness, you can probably round down further to 190 when specifying a range:
sudo badblocks -sb 4096 /dev/sdb1 200 190