Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


badblocks

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 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 READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED
    
    
    
    
    #  smartctl -l selftest /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 READ SMART DATA SECTION ===
    SMART Self-test log structure revision number 1
    Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
    # 1  Extended offline    Completed without error       00%     28460         -
    # 2  Short offline       Completed without error       00%     25709         -
    # 3  Short offline       Completed without error       00%     25541         -
    # 4  Short offline       Completed without error       00%     25218         -
    # 5  Short offline       Completed without error       00%     25113         -
    # 6  Short offline       Completed without error       00%     24960         -
    # 7  Short offline       Completed without error       00%     24813         -
    # 8  Short offline       Completed without error       00%     24656         -
    # 9  Short offline       Completed without error       00%     24488         -
    #10  Short offline       Completed without error       00%     24320         -
    #11  Short offline       Completed without error       00%     24152         -
    #12  Short offline       Completed without error       00%     23984         -
    
    
    # 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.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1