badblocks: check your HDD for bads

Published on Author admin

In general, it’s a good idea to check new HDD for badblocks. Sometimes its occur that a brand new HDD has defects that can crash your system. Here some examples how to do is in Unix-like systems: FreeBSD and Debian/Linux

FreeBSD:

Assume your new hdd is /dev/ada1

There are several ways to check HDD in FreeBSD. One of the best is to use “swiss-knife” dd program.

!!! WARNING !!! All the information from your HDD will be lost !!!

Another way is to use badblocks that comes from a set of utilities e2fsprogs  (sometimes called the e2fs programs).

You can find e2fsprogs in ports:

!!! WARNING !!! All the information from your HDD will be lost !!!

file badblocks_ada1.list will contain the statistics.

Notice: the 300Gb SAS HDD takes about 4 hours to complete the test using example.

Linux, Debian:

By default e2fsprogs is installed in Debian. But in case it wasn’t found you can install it by apt-get.
update collection:

Assume your new hdd is /dev/sdb

!!! WARNING !!! All the information from your HDD will be lost !!!