Badblocks

OptimalDuck

Dabbler
Joined
Jan 14, 2022
Messages
15
Hi,

I followed the steps in the resources to run badblocks and I'm curious if this is the expected behavior. I have two running at the same time and the bottom one is showing me a percentage done and seems normal. The first one however has a bunch of numbers just scrolling quickly. Is this what should be happening?

Screenshot.png
 
Joined
Jun 15, 2022
Messages
674
One option is to run multiple shells on the TrueNAS box....
Another is to run each job in the background with output piped to a different log file and use tail to watch file progress.
 

OptimalDuck

Dabbler
Joined
Jan 14, 2022
Messages
15
I believe I had them both running at the same time using tmux, but they aren't both behaving the same way, so it makes me think something has gone wrong.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
The first one however has a bunch of numbers just scrolling quickly. Is this what should be happening?
No, it isn't. Those numbers are the block numbers that badblocks believes to be bad.
 

OptimalDuck

Dabbler
Joined
Jan 14, 2022
Messages
15
No, it isn't. Those numbers are the block numbers that badblocks believes to be bad.
That’s what I was starting to think. It is hard to see them all as they scroll, but it looks like it is listing every number. Is that likely telling me that something else is wrong? Or is it likely that all those blocks are bad on a new drive?
 
Joined
Jun 15, 2022
Messages
674
If badblocks returned a bunch of good blocks then a bunch of bad blocks...it's working and something went wrong. Did you do a SMART test first? What prompted you to use badblocks?
 

OptimalDuck

Dabbler
Joined
Jan 14, 2022
Messages
15
If badblocks returned a bunch of good blocks then a bunch of bad blocks...it's working and something went wrong. Did you do a SMART test first? What prompted you to use badblocks?
Its a new drive, so I was testing it before using it as suggested in the resource I linked to in the first post. I did run a SMART test first, and it didn't show any problems.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Did you run a SMART Long/Extended test? Or just a Short test? If just a Short test, then run a Long test and see how that goes.

After you get done running badblocks, I'd check the SMART data again, then try badblocks again only on the suspect drive to verify the errors.

Sometimes you get a bad drive, hence the reason for testing them first. We hope all goes well but we all know that once in a blue moon something goes wrong.
 

OptimalDuck

Dabbler
Joined
Jan 14, 2022
Messages
15
I think i just ran short SMART tests. I missed that the guide had multiple tests listed.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
The short test does a test of the electronics and then a very quick surface test on a few areas, not the entire surface area like a Long test does. We recommend doing a SMART Long test first since it takes a fairly short period of time to run and if it finds problems then you do not need to use badblocks, which takes a long time to run since it runs 5 different test patterns.

We all learn something new.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
I just spent slightly less than two weeks testing 2*18TB disks with badblocks
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
There are a couple of reasons that badblocks is used in burn-in testing of the drives. Yes, there's the obvious of actually checking for bad blocks, but really the long SMART test ought to handle this. @OptimalDuck, I would suggest checking the SMART data for the drive in question (smartctl -a /dev/ada3, or whatever the drive number is); if there truly are bad blocks, they should show up there as well. But the other reason is simply to stress-test the drive for a while, to get it actively working for a while so that if it's going to fail, it will fail during testing rather than in production. It's not the only to do that, and it may not even be the best way to do that, but it's nonetheless effective.
 

OptimalDuck

Dabbler
Joined
Jan 14, 2022
Messages
15
Before I read everyone’s advice about the SMART tests I restarted badblocks and it seems to be going better this time. The first pass has completed and it’s onto the second (if I’m understanding it correctly). When it finishes I’ll run the SMART tests and see what happens. I think I may have messed things up while figuring out how to get it all setup the first time.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
If badblocks pass, all you should need to do is check the SMART attributes to see if all is good. I would also run a SMART Long test, only because that will be the test you will be running from this point forward to test your drives out. You should know that is passes without incident.
 

OptimalDuck

Dabbler
Joined
Jan 14, 2022
Messages
15
If badblocks pass, all you should need to do is check the SMART attributes to see if all is good. I would also run a SMART Long test, only because that will be the test you will be running from this point forward to test your drives out. You should know that is passes without incident.
How long should a long SMART test typically take on a 4tb drive?
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925

OptimalDuck

Dabbler
Joined
Jan 14, 2022
Messages
15
My badblocks completed without errors and I ran the long SMART tests and they also had no errors so I appear to be good. I'm not sure what I did wrong the first time, but it seems like it was a me problem. Thanks for the help everyone.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I'm not sure what I did wrong the first time
That doesn't matter, the end result is the drives are good right now. Glad it worked out for you.
 

Etorix

Wizard
Joined
Dec 30, 2020
Messages
2,134
How long should a long SMART test typically take on a 4tb drive?
smarctl -a /dev/$DRIVE tells you how long the test is (where $DRIVE is to be replaced by the appropriate da#, ada#, sdX).
 
Top