Running just two badblocks test pattern

was reading the bun in guide: Hard Drive Burn-in Testing | TrueNAS Community

I’m at the part of running bad blocks but i don’t want it to run all four tests, 0xaa (10101010), 0x55 (01010101), 0xff (11111111) and 0x00 (00000000), just 0x55 and 0xaa.
From what i’ve found so far the below is to run one pattern, but is there a way to run two?

badblocks -b 4096 -t 0xaa -wsv /dev/adaX

Also where does the V output to?

It goes to standard output. Since badblocks take hours, or even days, to run, you want to call it in a tmux session and redirect (>) or pipe (| tee) output to a file.
Have you tried invoking -t twice?

Just run @Spearfoot’s script

yes I’m following the Hard Drive Burn-in Testing | TrueNAS Community guide somewhat
but not no i don’t want to run the full test pattern twice, i want to run half of it. and was wonder if there was a way i can do it with one command

Thanks for the link but it doesn’t say how it’ll run only select test patterns, and not exactly sure of how to execute the script.

A really low-tech way to do it would be to just invoke it as usual, and hit Ctrl-C once it’s completed two passes.

Or you could get kind of fancy and do

for pattern in 0x55 0xaa; do
    badblocks -b 4096 -t $pattern -wsv /dev/foo
done

so assuming i have two drives i’ll do

tmux

this’ll open up a session and enter the below command int he terminal

for pattern in 0x55 0xaa; do
    badblocks -b 4096 -t $pattern -wsv /dev/adaX
done
Ctrl+B then "

repeat with the next drive
wait for a 1-2 days to complete

tmux attach

and read the results?

I looked at the badblocks command on truenas core, it seems to you can pass in multiple custom test patterns

example:

badblocks -b 4096 -wsv -t 0x55 -t 0xaa -o /logfilepath/da8.log /dev/da8

Documentation I found on the web about it here:

1 Like