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:
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.
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 ] |
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.