How long does badblocks take on a 1TB drive?

29

10

I'm running badblocks (or rather "e2fsck -c") on a 1TB drive and if the progress indicator is any indication (no pun intended), it's going to take almost forever to complete.

Right now it says 0.01% done, 30:20 elapsed which would mean the thing would take 17 weeks or so to complete, which seems rather excessive in my book.

Is that a normal amount of time for such a check to take or it simply that my suspicions are correct in that the drive is failing, thus causing the check to take only slightly shorter than eternity?

I found this question here, but that pertains to the amount of passes done.

Steven Don

Posted 2011-02-02T00:20:02.427

Reputation: 971

In addition to Zoredache's comment above, different switches to badblocks cause it to perform different tasks, which will also affect runtimes, for example the -w switch. – JeffG – 2011-03-07T17:58:46.003

Note that the -w option involves the complete removal of the unit, so its use should be avoided in every unit containing useful information for the user. – None – 2014-12-18T00:22:49.730

2It almost certainly depends on the interface, the drive, and how bad the drive is, if there is actually any failures. I can tell you on one of my computers a badblocks scan took ~70 hours for a 1.5TB drive attached through SATA. If you where connected via USB2.0, or 1.0 it would be far longer. – Zoredache – 2011-02-02T00:38:21.890

It is attached using e-SATA. I suppose I'll just give it a while and see how far along it is after a good night's sleep. – Steven Don – 2011-02-02T00:43:05.537

@Zoredache - I think your comment should be an answer instead. – Nifle – 2011-02-02T06:02:14.063

1The time required would (also) depend on the mode badblocks is running in: read-only, non-destructive read-write or destructive read-write. Having said that, 30 minutes for 0.1% does seem long. – SabreWolfy – 2012-06-22T14:10:40.257

That's 30 minutes for 0.01%, not 0.1%. Anyway, the question is rather old. The drive had indeed failed (spectacularly). – Steven Don – 2012-06-27T09:28:43.153

Answers

20

To answer you question, the closest I can offer is with a 3TB I tested for this. Here are the 3 times tests I did, only changing the parameter values for -c and only doing them up to 10% since they took A LOT of time. Each was done 3 times to get an average.

badblocks -svn /dev/sdb

To get to 1%: 1 Hour
To get to 10%: 8 hours 40 minutes

badblocks -svn -b 512 -c 32768 /dev/sda

To get to 1%: 35 Minutes
To get to 10%: 4 hours 10 minutes

badblocks -svn -b 512 -c 65536 /dev/sda

To get to 1%: 16 Minutes
To get to 10%: 2 hours 35 minutes

So yes, the -c parameter has a very big influence on the time it takes to check the drive. I would guess that for a 1 TB Hard drive, assuming it maintains the same time frame as the 3TB, it would be 1/3 of the time mentioned here, so to get to 10% with -c 65536 on the 1 TB HDD it would be about 50 minutes.

CYREX

Posted 2011-02-02T00:20:02.427

Reputation: 336

5

Badblocks makes 4 runs. On a 1 TB external HD it usually takes around 70 hours.

NotFromBrooklyn

Posted 2011-02-02T00:20:02.427

Reputation: 51

@SabreWolfy where did you read that badblocks does for runs with -w? I cannot find this information. – Alan Franzoni – 2017-03-31T09:30:12.013

1The man page for -w shows the four write patterns it uses. – SabreWolfy – 2017-03-31T09:35:15.340

4For completeness, badblocks (only) defaults to four runs with the -w destructive-write flag. – SabreWolfy – 2012-06-22T14:09:03.270

3

I'm running badblocks on WD Red 4TB drives. Since they're 4k sector drives (checked using lsblk -o NAME,PHY-SeC) I'm running it with -b 4096. I wanted to give each of the badblocks instances ~800Mb of RAM so I used -c 200000 which gives you 4096 bytes * 200,000 blocks = 800,000 Kb. They started out with abour 800Mb each but that crept up over time. These settings do provide a significant speedup over standard settings though.

It ran 1% in 3min 56sec but that's 1% of 4 patterns. It also seems to take more time the closer you get to the end of a run. It checked the disk with the first pattern in about 17hrs so it should complete 4TB in about 68hr.

COMMAND BELOW RUNS A DESTRUCTIVE WRITE

Command I'm using is: badblocks -svw -b 4096 -c 200000 /dev/sdc -o bb_sdc.txt

CamW

Posted 2011-02-02T00:20:02.427

Reputation: 131

3

Try increasing amount of blocks processed together, like in badblocks -svn -b 512 -c 65536 /dev/sda. In this way, I can get a 1 TB hard disk drive checked in 8 hours.

user326852

Posted 2011-02-02T00:20:02.427

Reputation: 31

0

Ran this the day before yesterday on a failed 1 TB drive in my 6TB RAID 6 (DESTRUCTIVE WRITE MODE!):

# badblocks -svw -b 4096 -c 65536 /dev/sdb

Mainboard is an ASRock Rack C2550D4I (I know…) with 8x Samsung SpinPoint M8 HN-M101MBB (I know…) connected to the SATA3 Ports. The drives are 4K "Advanced Format" drives, hence the 4K block size.

badblocks took about 28 hours to finish, with no errors.

The single drives do ~105 MB/sec (average hdparm -tT buffered read timing), 200–230 MB/sec when testing the whole array. Nothing superior, nowadays, but nice for a pile of old Laptop drives.

Hope this helps as much as this thread helped me to find a quick way to do a badblocks run on the disk. I know its use is dubious these days, but when a previous smartctl -t long failed due to read failures, I decided to have all sectors touched and rewritten a few times to see how the S.M.A.R.T. values would change. Another smartctl Test is pending, if that again fails, I shall shop for a new drive.

memartin

Posted 2011-02-02T00:20:02.427

Reputation: 56

-1

Some performance observations:

I'm running e2fsck -c -c -v /dev/sda2, which resides on this device:

/dev/sda2  77056 976754431 976677376  3.7T Linux filesystem

The current runtime for 63.5% is 53:28:40; 53.5 hours. The rate of progress is 1.186%/hour. At this rate, it will take an additional 31 hours to complete, with an estimated total run time of 85 hours. This a USB 3.0 device. iotop indicates the average read/write speed is about 25MB/s. So far, zero bad blocks have been found.

The underlying command line run by e2fsck is:

sh -c badblocks -b 4096 -X -s -n /dev/sda2 976677375

Posts to StackOverflow state it is safe to interrupt badblocks with ^C (SIGTERM). Should I do so, I don't see the downside of stopping this test, and resuming it in the future later, as this is a disk block-level operation. I must unmount this filesystem before resuming at the percent scan completed.

numberer6

Posted 2011-02-02T00:20:02.427

Reputation: 1

3is this a question or answer? – Pierre.Vriens – 2018-05-27T11:51:04.083