0

I have a 4TB hard drive which I ran the badblocks utility without passing in the -b block-size parameter. So I'm pretty sure it defaulted it to 1024, and my 4TB drive/filesystem is most likely setup with a block size of 4096. Is there a way I can translate the results to match the 4096 block size? For example, if the bad block is #5 with block-size=1024, it would map to block #2 with block-size=4096. Is that a valid conversion from 1024 to 4096?

If so, then I can re-run badblocks and specify a start and end range which will save me a lot of time.

1 Answer 1

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.