2

TL;DR: Are the second-hand drive that I've purchased, safe to use for a copy of my backup NAS?


I bought four Western Digital 3TB Red HDDs second-hand and have put them into a spare microserver that I have. I was planning on using this setup as a secondary, offsite backup copy of my exiting onsite (backup) NAS.

I've run an "Extended Self Test" on each of the drives using smartctl. Three of the tests on /dev/sdb, /dev/sdc & /dev/sdd "Completed without error", but the test on /dev/sda "Completed: read failure".

  1. Are these physical or logical bad blocks?
  2. If they're logical, how can I repair them?
  3. If they're physical, is it safe to continue using the drive(s) in my RAID array, or should I really for out the cash for a new drive?

I've read through all information on "BadBlock How To" page but it doesn't give any information relevant to RAID arrays. Specifically regarding how to take the RAID offset into account when trying to calculate the block number.

I was reading through this answer to a similar question where someone mention that you have to take into account the "RAID Data Offset", but don't really clarify it further. They also have a RAID 1 array, not RAID 5. The equations I'm referring to is:

 b = (int)((L-S)*512/B)

where:
b = File System block number
B = File system block size in bytes
L = LBA of bad sector
S = Starting sector of partition as shown by fdisk -lu
and (int) denotes the integer part.

Also, from that example, when I run: sudo fdisk -lu /dev/md0 I only get the following:

> sudo fdisk -lu /dev/md0
Disk /dev/md0: 8.19 TiB, 9001371697152 bytes, 17580804096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 524288 bytes / 1572864 bytes

I'm not presented with drive table information such as: Device Boot Start End Blocks Id System

I also don't get much more information when I run: sudo fdisk -lu /dev/sda

> sudo fdisk -lu /dev/sda
Disk /dev/sda: 2.75 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: WDC WD30EFRX-68A
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

This means that I don't know the starting sector of the partition on /dev/sda. If I use the RAID Data Offset value of 264192 and substitute that in for S in the equation, I end up with: [(1342886576 - 264192) * 512] / 4096 = 167827798

If I then run sudo hdparm --read-sector 167827798 /dev/sd0, I get reading sector 167827798: succeeded as a result.

So either I've got the block/sector number wrong, or the bad block is actually fine...

Can anyone help me out further? I've included the smartctl outputs below.


/dev/sda

  • SMART Overall: PASSED
  • Extended Offline: Read failure
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-31-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC WD30EFRX-68AX9N0
Serial Number:    WD-WMC1T3647350
LU WWN Device Id: 5 0014ee 6ae046f8e
Firmware Version: 80.00A80
User Capacity:    3,000,592,982,016 bytes [3.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2 (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Fri May 22 10:41:12 2020 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      ( 113) The previous self-test completed having
                    the read element of the test failed.
Total time to complete Offline 
data collection:        (39900) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    ( 400) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x70bd) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       11
  3 Spin_Up_Time            0x0027   185   179   021    Pre-fail  Always       -       5741
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       41
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   042   042   000    Old_age   Always       -       42583
 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       41
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       27
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       13
194 Temperature_Celsius     0x0022   121   110   000    Old_age   Always       -       29
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       4
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       1

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed: read failure       10%     42562         1342886576
# 2  Extended offline    Completed: read failure       90%     42534         1342886576
# 3  Short offline       Completed without error       00%     42534         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

/dev/sdb

  • SMART Overall: PASSED
  • Extended Offline: Completed without error
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-31-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC WD30EFRX-68AX9N0
Serial Number:    WD-WMC1T3613933
LU WWN Device Id: 5 0014ee 6ae04400b
Firmware Version: 80.00A80
User Capacity:    3,000,592,982,016 bytes [3.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2 (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Fri May 22 10:47:03 2020 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:        (40860) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    ( 410) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x70bd) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       1
  3 Spin_Up_Time            0x0027   182   176   021    Pre-fail  Always       -       5858
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       58
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       1
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   085   084   000    Old_age   Always       -       11555
 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       41
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       28
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       12
194 Temperature_Celsius     0x0022   120   111   000    Old_age   Always       -       30
196 Reallocated_Event_Count 0x0032   199   199   000    Old_age   Always       -       1
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

SMART Error Log Version: 1
ATA Error Count: 32 (device log contains only the most recent five errors)
    CR = Command Register [HEX]
    FR = Features Register [HEX]
    SC = Sector Count Register [HEX]
    SN = Sector Number Register [HEX]
    CL = Cylinder Low Register [HEX]
    CH = Cylinder High Register [HEX]
    DH = Device/Head Register [HEX]
    DC = Device Command Register [HEX]
    ER = Error register [HEX]
    ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 32 occurred at disk power-on lifetime: 1796 hours (74 days + 20 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  04 61 42 10 51 6f ae  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 03 42 10 51 6f ae 00  43d+23:51:57.394  SET FEATURES [Set transfer mode]
  ef 03 0c 10 51 6f ae 00  43d+23:51:57.393  SET FEATURES [Set transfer mode]
  ec 00 01 00 00 00 a0 00  43d+23:51:57.392  IDENTIFY DEVICE
  ef 90 06 00 00 00 40 00  43d+23:51:38.870  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.869  SET FEATURES [Disable SATA feature]

Error 31 occurred at disk power-on lifetime: 1796 hours (74 days + 20 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  04 61 0c 10 51 6f ae  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 03 0c 10 51 6f ae 00  43d+23:51:57.393  SET FEATURES [Set transfer mode]
  ec 00 01 00 00 00 a0 00  43d+23:51:57.392  IDENTIFY DEVICE
  ef 90 06 00 00 00 40 00  43d+23:51:38.870  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.869  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.869  SET FEATURES [Disable SATA feature]

Error 30 occurred at disk power-on lifetime: 1796 hours (74 days + 20 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  04 61 06 00 00 00 40  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 90 06 00 00 00 40 00  43d+23:51:38.870  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.869  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.869  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.868  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.868  SET FEATURES [Disable SATA feature]

Error 29 occurred at disk power-on lifetime: 1796 hours (74 days + 20 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  04 61 06 00 00 00 40  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 90 06 00 00 00 40 00  43d+23:51:38.869  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.869  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.868  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.868  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.867  SET FEATURES [Disable SATA feature]

Error 28 occurred at disk power-on lifetime: 1796 hours (74 days + 20 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  04 61 06 00 00 00 40  Device Fault; Error: ABRT

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 90 06 00 00 00 40 00  43d+23:51:38.869  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.868  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.868  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.867  SET FEATURES [Disable SATA feature]
  ef 90 06 00 00 00 40 00  43d+23:51:38.667  SET FEATURES [Disable SATA feature]

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%     11531         -
# 2  Extended offline    Aborted by host               10%     11521         -
# 3  Short offline       Completed without error       00%     11506         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

/dev/sdc

  • SMART Overall: PASSED
  • Extended Offline: Completed without error
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-31-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC WD30EFRX-68AX9N0
Serial Number:    WD-WMC1T3643940
LU WWN Device Id: 5 0014ee 60359ae37
Firmware Version: 80.00A80
User Capacity:    3,000,592,982,016 bytes [3.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2 (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Fri May 22 10:48:40 2020 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:        (40080) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    ( 402) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x70bd) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   182   177   021    Pre-fail  Always       -       5858
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       42
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   042   042   000    Old_age   Always       -       42582
 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       42
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       29
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       12
194 Temperature_Celsius     0x0022   120   111   000    Old_age   Always       -       30
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

SMART Error Log Version: 1
No Errors Logged

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%     42558         -
# 2  Short offline       Completed without error       00%     42543         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

/dev/sdd

  • SMART Overall: PASSED
  • Extended Offline: Completed without error
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-31-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC WD30EFRX-68AX9N0
Serial Number:    WD-WMC1T3642983
LU WWN Device Id: 5 0014ee 658ae70cd
Firmware Version: 80.00A80
User Capacity:    3,000,592,982,016 bytes [3.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2 (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Fri May 22 10:49:48 2020 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:        (40320) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    ( 404) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x70bd) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   181   175   021    Pre-fail  Always       -       5950
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       42
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   047   047   000    Old_age   Always       -       39003
 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       42
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       29
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       12
194 Temperature_Celsius     0x0022   120   112   000    Old_age   Always       -       30
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

SMART Error Log Version: 1
No Errors Logged

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%     38979         -
# 2  Short offline       Completed without error       00%     38969         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

Output from sudo mdadm --examine /dev/sda

> sudo mdadm --examine /dev/sda
/dev/sda:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x9
     Array UUID : 1457ad95:8434aaa1:93949de6:2e100471
           Name : remote-nas:0  (local to host remote-nas)
  Creation Time : Tue May 19 17:05:24 2020
     Raid Level : raid5
   Raid Devices : 4

 Avail Dev Size : 5860268976 (2794.39 GiB 3000.46 GB)
     Array Size : 8790402048 (8383.18 GiB 9001.37 GB)
  Used Dev Size : 5860268032 (2794.39 GiB 3000.46 GB)
    Data Offset : 264192 sectors
   Super Offset : 8 sectors
   Unused Space : before=264112 sectors, after=944 sectors
          State : clean
    Device UUID : 7dc7b151:ee18b088:a54a5a7d:201420d3

Internal Bitmap : 8 sectors from superblock
    Update Time : Fri May 22 10:02:30 2020
  Bad Block Log : 512 entries available at offset 24 sectors - bad blocks present.
       Checksum : e90608f7 - correct
         Events : 20196

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 0
   Array State : AAAA ('A' == active, '.' == missing, 'R' == replacing)
3
  • None of the drives is listed by md as failed, so if there's errors, md has been picking them up and correcting as it goes along. At the moment things seem to be ok. However if you're discussing data safety and fault recovery, as soon as you see errors showing up, replace the drive as quickly as possible, as it is only a matter of time until it fails. Admittedly all drives fail given enough time, but those that have given a warning will almost certainly fail sooner. Soon probably. Look at it this way: you've been warned by the OS.
    – Pedro
    May 22, 2020 at 11:26
  • Thanks very much for the reply! Okay, as long as things will continue to tick over and be fine for the moment, then I guess I don't have too much to worry about. I'll just start putting away some money for a new replacement drive. You last sentence does drive home the message though.
    – Electr0
    May 22, 2020 at 16:10
  • I'd be on eBay/Amazon now. If you loose 1 drive, you end up with 0 redundancy. On a raid5, if you loose 2 (unless you have multiple hot spares) then you loose all data.
    – Pedro
    May 22, 2020 at 16:49

1 Answer 1

2

Are these physical or logical bad blocks?

Kind of both. Physical (the drive itself) is the Completed: read failure SMART test result. Also a non-zero value for Reallocated/Pending/Uncorrectable blocks.

Logical (mdadm metadata) is bad blocks present in the mdadm Bad Block Log. You can check mdadm --examine-badblocks (for each drive individually) too. If you have identical bad blocks on multiple drives, the md device will return soft read errors for those.

is it safe to continue using the drive(s) in my RAID array

I would not trust drives that failed SMART or lost data to unreadable sectors. Replace it, put it through a write-read-verify test, then decide.

If they're logical, how can I repair them?

Ideally the bad block log entries would go away when mdadm --replaceing the offending drive.

If the entries persist after replace because they are identical on multiple drives (no redundancy for those blocks), and the md array returns soft read errors, you can forcibly wipe the Bad Block Log with mdadm --assemble --update=force-no-bbl.

The md array might then return false or outdated data for the blocks that were in this log afterwards, possibly resulting in data corruption.

2
  • Thanks for the reply @frostschutz ! Okay, well that's good to know then. I just ran the mdadm --examine-badblocks command. Both sda and sdd report having the exact same bad blocks (4 different blocks, each for 8 sectors). Where as sdb and sdc report that the bab-blocks list is empty. Regarding what you said, does this mean that bad-blocks from sda have been replicated (or also marked as bad) on sdd? Also, does this mean that I now have to replace two drives (sda & sdd) or just the SMART-failed sda drive?
    – Electr0
    May 22, 2020 at 16:16
  • Yes, it seems they've replicated. Unfortunately that's very common issue with mdadm's Bad Block Log. You only have to replace faulty drives, but to get rid of the bad block entries, forcibly disabling the Bad Block Log altogether is the only way I'm aware of for now. May 22, 2020 at 21:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .