[NCLUG] badblocks and smartctl?

John Gilmore j.arthur.gilmore at gmail.com
Mon May 26 06:54:56 MDT 2014


I've got a Hard drive that smartctl is reporting 1 offline
uncorrectable sector on. I get an email about it per day, and it says:

>The following warning/error was logged by the smartd daemon:
>
>Device: /dev/sda [SAT], 1 Currently unreadable (pending) sectors

So, I figure I'll write to that sector and force a remapping, right?
Well which sector? Here's the output from badblocks:

>%sudo badblocks -b 512 -c 256 -e 5 -sv /dev/sda
>Checking blocks 0 to 3907029167
>Checking for bad blocks (read-only test): done
>Pass completed, 0 bad blocks found. (0/0/0 errors)

So there are no bad blocks? Maybe it was corrected? So below find the
output from smartctl -a, which *still* shows an uncorrectable sector
(not that the raw_value of "Current_Pending_Sector" and
"Offline_Uncorrectable" is 1)

Also note that the error log says "UNC at LBA = 0x0fffffff =
268435455" which *is* in the range that badblocks scanned. I'd go
ahead with the assumption that it's accurate, and use dd to touch that
sector (I'm using zfs with a mirror, so I can just scrub and any
corruption will be corrected afterwards, I don't have to worry about
damaging my data)

However, I'm concerned about doing that because "0x0fffffff" is just
such a nice round number that I suspect it's inaccurate, or that
something else is going on. I suppose that there'd be no real harm in
touching that sector anyway. I could even use dd to read it first. but
the badblocks results make no sense to me, wouldn't badblocks have
found it first if it was really bad?

I'm getting kind of tired of these constant emails about this issue.
It's like the boy who cried wolf - I really don't want to be in the
habit of ignoring emails from smartd!

%sudo smartctl -a /dev/sda
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-4-amd64] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda Green (Adv. Format)
Device Model:     ST2000DL003-9VT166
Serial Number:    5YD4XZER
LU WWN Device Id: 5 000c50 03d353474
Firmware Version: CC32
User Capacity:    2,000,398,934,016 bytes [2.00 TB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Mon May 26 06:42:07 2014 MDT
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:  (0x82)    Offline data collection activity
                    was completed without error.
                    Auto Offline Data Collection: Enabled.
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:         (  612) 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:      (   1) minutes.
Extended self-test routine
recommended polling time:      ( 255) minutes.
Conveyance self-test routine
recommended polling time:      (   2) minutes.
SCT capabilities:            (0x30b7)    SCT Status supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE
UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   106   099   006    Pre-fail
Always       -       116640
  3 Spin_Up_Time            0x0003   093   092   000    Pre-fail
Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age
Always       -       91
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail
Always       -       0
  7 Seek_Error_Rate         0x000f   080   060   030    Pre-fail
Always       -       26561998355
  9 Power_On_Hours          0x0032   076   076   000    Old_age
Always       -       21478
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail
Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age
Always       -       139
183 Runtime_Bad_Block       0x0032   001   001   000    Old_age
Always       -       260
184 End-to-End_Error        0x0032   100   100   099    Old_age
Always       -       0
187 Reported_Uncorrect      0x0032   099   099   000    Old_age
Always       -       1
188 Command_Timeout         0x0032   100   091   000    Old_age
Always       -       74
189 High_Fly_Writes         0x003a   100   100   000    Old_age
Always       -       0
190 Airflow_Temperature_Cel 0x0022   069   051   045    Old_age
Always       -       31 (Min/Max 31/36)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age
Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age
Always       -       109
193 Load_Cycle_Count        0x0032   100   100   000    Old_age
Always       -       139
194 Temperature_Celsius     0x0022   031   049   000    Old_age
Always       -       31 (0 15 0 0)
195 Hardware_ECC_Recovered  0x001a   018   006   000    Old_age
Always       -       116640
197 Current_Pending_Sector  0x0012   100   100   000    Old_age
Always       -       1
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age
Offline      -       1
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age
Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age
Offline      -       50281182155357
241 Total_LBAs_Written      0x0000   100   253   000    Old_age
Offline      -       763897891
242 Total_LBAs_Read         0x0000   100   253   000    Old_age
Offline      -       4164416946

SMART Error Log Version: 1
ATA Error Count: 36 (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 36 occurred at disk power-on lifetime: 935 hours (38 days + 23 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
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 08 ff ff ff ef 00      03:34:18.087  READ DMA EXT
  27 00 00 00 00 00 e0 00      03:34:18.086  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      03:34:18.078  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      03:34:18.046  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00      03:34:18.046  READ NATIVE MAX ADDRESS EXT

Error 35 occurred at disk power-on lifetime: 935 hours (38 days + 23 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
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 08 ff ff ff ef 00      03:34:18.087  READ DMA EXT
  27 00 00 00 00 00 e0 00      03:34:18.086  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      03:34:18.078  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      03:34:18.046  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00      03:34:18.046  READ NATIVE MAX ADDRESS EXT

Error 34 occurred at disk power-on lifetime: 935 hours (38 days + 23 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
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 08 ff ff ff ef 00      03:34:17.623  READ DMA EXT
  27 00 00 00 00 00 e0 00      03:34:17.622  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      03:34:17.614  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      03:34:17.582  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00      03:34:17.582  READ NATIVE MAX ADDRESS EXT

Error 33 occurred at disk power-on lifetime: 935 hours (38 days + 23 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
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 08 ff ff ff ef 00      03:34:17.623  READ DMA EXT
  27 00 00 00 00 00 e0 00      03:34:17.622  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      03:34:17.614  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      03:34:17.582  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00      03:34:17.582  READ NATIVE MAX ADDRESS EXT

Error 32 occurred at disk power-on lifetime: 935 hours (38 days + 23 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
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 08 ff ff ff ef 00      03:34:17.155  READ DMA EXT
  27 00 00 00 00 00 e0 00      03:34:17.154  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      03:34:17.146  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      03:34:17.114  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00      03:34:17.114  READ NATIVE MAX ADDRESS EXT

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining
LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%     21475         -
# 2  Short offline       Completed without error       00%     21451         -
# 3  Extended offline    Completed without error       00%     21432         -
# 4  Short offline       Completed without error       00%     21403         -
# 5  Extended offline    Interrupted (host reset)      90%     21393         -
# 6  Short offline       Completed without error       00%     21386         -
# 7  Short offline       Completed without error       00%     21362         -
# 8  Extended offline    Completed without error       00%     21343         -
# 9  Short offline       Completed without error       00%     21314         -
#10  Extended offline    Completed without error       00%     21313         -
#11  Short offline       Completed without error       00%     21124         -
#12  Short offline       Completed without error       00%     21100         -
#13  Short offline       Completed without error       00%     21076         -
#14  Extended offline    Completed without error       00%     21057         -
#15  Short offline       Completed without error       00%     21028         -
#16  Short offline       Completed without error       00%     21004         -
#17  Short offline       Completed without error       00%     20980         -
#18  Short offline       Completed without error       00%     20956         -
#19  Short offline       Completed without error       00%     20936         -
#20  Short offline       Interrupted (host reset)      00%     20925         -
#21  Short offline       Completed without error       00%     20909         -

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.


More information about the NCLUG mailing list