Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


badblocks

This is an old revision of the document!


~~TOC~~

Test hard drive for defects, find bad blocks

smartctl

  • Start the smartctl long test:
    # smartctl -t long /dev/sdb
    smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-229.11.1.el7.x86_64] (local build)
    Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
    
    === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
    Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
    Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
    Testing has begun.
    Please wait 384 minutes for test to complete.
    Test will complete after Mon Sep  7 14:01:01 2015
    
    Use smartctl -X to abort test.
  • Show health (after test):
    # smartctl -H /dev/sdb
    
    # smartctl -l selftest /dev/sdb
    # smartctl -a /dev/sdb

badblocks

  • Start screen, badblocks is a long running process. Using it on one of my 2TB disks took 6 days. You can speed it up with the -b and -c option.
  • Non-destructive search for bad blocks:
    # badblocks -nsv /dev/sdb
    Checking for bad blocks in non-destructive read-write mode
    From block 0 to 1953514583
    Checking for bad blocks (non-destructive read-write test)
    Testing with random pattern:   0.00% done, 0:21 elapsed. (0/0/0 errors)
badblocks.1441604667.txt.gz · Last modified: 2015/09/07 05:44 by admin