3

It has been 50h and it is only 0.04% of the way through... Which if my maths is correct means it will be finished after another 2,000,000h (not real maths)

hutber@hutber:~$ badblocks -svw -b 4096 -c 200000 /dev/sda -o bb_sdc.txt
Checking for bad blocks in read-write mode
From block 0 to 1953506645
Testing with pattern 0xaa:   0.04% done, 50:47:27 elapsed. (0/783975/0 errors)

Is there a way I can run this without it taking so long?

2 Answers2

5

The correct way to bad block a disk is to use e2fsck, not badblocks directly. See man badblocks for more details...

It is strongly recommended that users not run badblocks directly, but rather use the -c option of the e2fsck and mke2fs programs

Note: do NOT abort a bad block scan!

Note: do NOT bad block a SSD

Note: backup your important files FIRST!

Note: this will take many hours

Note: you may have a pending HDD failure

Boot to a Ubuntu Live DVD/USB in “Try Ubuntu” mode.

In terminal...

sudo fdisk -l # identify all "Linux Filesystem" partitions

sudo e2fsck -fcky /dev/sdXX # read-only test

or

sudo e2fsck -fccky /dev/sdXX # non-destructive read/write test (recommended)

The -k is important, because it saves the previous bad block table, and adds any new bad blocks to that table. Without -k, you loose all of the prior bad block information.

The -fccky parameter...

   -f    Force checking even if the file system seems clean.

-c This option causes e2fsck to use badblocks(8) program to do a read-only scan of the device in order to find any bad blocks. If any bad blocks are found, they are added to the bad block inode to prevent them from being allocated to a file or direc‐ tory. If this option is specified twice, then the bad block scan will be done using a non-destructive read-write test.

-k When combined with the -c option, any existing bad blocks in the bad blocks list are preserved, and any new bad blocks found by running badblocks(8) will be added to the existing bad blocks list.

-y Assume an answer of `yes' to all questions; allows e2fsck to be used non-interactively. This option may not be specified at the same time as the -n or -p options.

heynnema
  • 73,649
4

Before changing the default variables, you should learn what they are doing.

You problem is here:

-b 4096 -c 200000

Indication that you are doing it wrong is:

(0/783975/0 errors)

You are asking the drive to write and read 781MB each time (200000 times 4096). This is beyond the capability of any SOHO drive and even most enterprise drives would not be able to handle this. These options are for optimizing for unusual drives. Some suffer bottleneck by bus and some have limits of the technology. Fitting these can allow for better precision at faster speeds - you just went the opposite way.

Here are the explanations behind the two (man badblocks):

-b block_size Specify the size of blocks in bytes. The default is 1024.

-c number of blocks is the number of blocks which are tested at a time. The default is 64.

Regarding using badblocks on SSDs, there is no reason to never do it. Just do not do it for no reason. SSDs have limited lifespan and are not block devices. This means you are not getting actual block information of the NAND, just testing the drive ability to fill with data.