Article 6NE9P badblocks: How to start at an offset without having to specify a last block?

badblocks: How to start at an offset without having to specify a last block?

by
exerceo
from LinuxQuestions.org on (#6NE9P)
The syntax of badblocks is:

Quote:
badblocks [ -svwnfBX ] [ -b block_size ] [ -c blocks_at_once ] [ -d read_delay_factor ] [ -e max_bad_blocks ] [ -i input_file ] [ -o output_file ] [ -p num_passes ] [ -t test_pattern ] device [ last_block ] [ first_block ]
So you are forced to specify a last block to be able to specify a first block. If the goal is to start at an offset and check all remaining blocks, you have to manually calculate the last block by dividing the device byte size by the block size every time.

The block size can be something else than 512. It can be manually specified, and on optical discs, it is 2048 by default.

Is there any alternative to badblocks that has a proper offset parameter? Or is a custom function necessary for this?

I was going to make a function where you can set a percentage offset.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments