Home > bash, linux > check a new HDD for bad blocks

check a new HDD for bad blocks

Problem
You buy/get a new HDD and you want to make sure that it has no bad sectors. How to check that?

Solution
I found a solution here. In short:

sudo badblocks -wvs /dev/sdx

where /dev/sdx is the drive. WARNING! This is a destructive check, i.e. all data on the drive will be lost!

The -w option tells badblocks to write a known pattern, then read back the data to make sure it matches the pattern. It does this 4 times, using the patterns 0xaa, 0x55, 0xff, and 0x00 (alternating 0’s and 1’s, then all 1’s, then all 0’s). Note that this will overwrite all data on the drive and wipe out all the partitions, as well.” (source)

Advertisements
Categories: bash, linux Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: