SOLVED Fixing Bad Sectors without loosing the disk?

Status
Not open for further replies.

Adam

Dabbler
Joined
Jun 10, 2013
Messages
10
Hello

I recently suffered a power cut at my house and after resuming my system I had the following error:

Jul 26 11:44:32 freenas smartd[25350]: Device: /dev/ada2, 336 Currently unreadable (pending) sectors

Now I've read a couple of posts about fixing this error and they all appear to advise to overwrite the entire disk.
Now I don't have any RAID setup, I know that any data I have in those sectors is lost, and that's a risk I accepted when setting up the system.

However the error appears to be repeating forever and what I need to do is declare the sectors as unwritable and get rid of this error, but without loosing any more data.

Is there any way of doing this?
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
Please post smartctl -a /dev/ada2 .. I would get a new disk for replacement.. I just consider it to risky to continue placing critical data on a disk that starts running into bad sectors. The disk might be able to remap them normally but most likely an indicator of a bad disk or one starting to go bad..
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
The best advice I can give you is to backup your data and RMA the drive. No matter how you slice it the drive is defective and will likely become worse.

However there is a thread here in which a user was able to lock out failed sectors and all things were good again. I'm curious on what his drive looks like now or in 1 month.

And when you reply to this thread, post your FreeNAS version and hardware configuration. You said you don't have a RAID setup, then what do you have?

As YAtti420 said, post the output of smartctl -a /dev/ada2 (paste it in code brackets or use www.pastebin.com and give us the link, this will retain the format) as we will tell you how bad it really is. If you are running ZFS you can perform a scrub to see if you actually have any corrupt data, it will tell you and fix anything it can.

Good Luck
 

Adam

Dabbler
Joined
Jun 10, 2013
Messages
10
System Spec:
Running FreeNAS-9.2.1.5-RELEASE-x64 (80c1d35) on 16Gb USB
Intel Pentium G2020 2.90GHz
8GB (2x4GB) DDR3 1333MHz
Gigabyte GA-B75N MoBo
Antec Earth Watts 380W

Storage:
2x WD 2Tb drives and 1x WD 3Tb drive configured in a single ZFS stripe

The 3Tb drive is the one with the error, and is just over a year old.

Output of smartctl -a /dev/ada2

Code:
[root@freenas] ~#  smartctl -a /dev/ada2
smartctl 6.2 2013-07-26 r3841 [FreeBSD 9.2-RELEASE-p4 amd64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family:  Western Digital Caviar Green (AF, SATA 6Gb/s)
Device Model:  WDC WD30EZRX-00DC0B0
Serial Number:  WD-WMC1T2658014
LU WWN Device Id: 5 0014ee 0038763fd
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:  Sun Jul 27 15:42:35 2014 BST
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:  ( 116) The previous self-test completed having
  the read element of the test failed.
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:  (0x70b5) SCT Status 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  -  255
  3 Spin_Up_Time  0x0027  184  182  021  Pre-fail  Always  -  5791
  4 Start_Stop_Count  0x0032  099  099  000  Old_age  Always  -  1397
  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  088  088  000  Old_age  Always  -  8974
10 Spin_Retry_Count  0x0032  100  100  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  -  11
192 Power-Off_Retract_Count 0x0032  200  200  000  Old_age  Always  -  6
193 Load_Cycle_Count  0x0032  145  145  000  Old_age  Always  -  165164
194 Temperature_Celsius  0x0022  120  114  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  -  336
198 Offline_Uncorrectable  0x0030  200  200  000  Old_age  Offline  -  336
199 UDMA_CRC_Error_Count  0x0032  200  200  000  Old_age  Always  -  0
200 Multi_Zone_Error_Rate  0x0008  199  199  000  Old_age  Offline  -  475
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  40%  8916  2297040336
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.



So if I do go down the route of replacing the drive, what's the best option for backup given that the case is currently full with the current drives?
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
It looks like the drive has a lot of bad sectors
.. I would look up the thread about replacing bad hard drives as this one looks flakey.. I would backup all data to be safe..

Sent from my SGH-I257M using Tapatalk 2
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Backup to some external machine is the safest way. I say that because I don't know your experience level. I would hook up an external USB hard drive to my main computer and start copying data off the NAS on to the USB hard drive.

So what is the output of "zpool status". I ask because I want to be 100% certain of your configuration. You say it's a single strip but your interpretation and mine could be different. It's best to be on the same page by listing the output of that command.
 

Adam

Dabbler
Joined
Jun 10, 2013
Messages
10
I'm fairly experienced with IT in general but don't have much experience with ZFS. For instance I'm presuming I'd be able to backup just the 3Tb drive and restore the data to the pool on another disk? But would the pool be functional without the disk in the mean time or is file information stored across multiple disks? Also would I have to copy the bit level drive data or just the files?

I'm currently using 3.6 TiB in the pool but the issue with backing up is I don't have that much space available anywhere else currently and so would have to buy some storage unless I can backup only the data on that disk.

Code:
[root@freenas] ~# zpool status
  pool: Primary
 state: ONLINE
status: One or more devices has experienced an error resulting in data
  corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
  entire pool from backup.
  see: http://illumos.org/msg/ZFS-8000-8A
  scan: scrub repaired 0 in 10h13m with 9 errors on Sun Jul 20 18:13:41 2014
config:

  NAME  STATE  READ WRITE CKSUM
  Primary  ONLINE  0  0  0
  gptid/a408ae4f-d058-11e2-b215-902b34d5a1d4  ONLINE  0  0  0
  gptid/7b32e59f-e710-11e2-9f99-902b34d5a1d4  ONLINE  0  0  0
  gptid/7b979074-e710-11e2-9f99-902b34d5a1d4  ONLINE  0  0  0

errors: 1 data errors, use '-v' for a list
[root@freenas] ~#
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
You appear to have your three drives configured into a single striped zpool. This means that you have no data redundancy at all, and if any of your drives fail you will lose all your data. This also means, unless I'm mistaken, that there's no way to replace a single disk in the pool while preserving the pool--your only option will be to back up the data, create a new pool with the new drive (hopefully in a more redundant configuration), and then restore the data to the new pool.

The good news is that there appears to be only the one data error--"zpool status -v" should show you where it is.
 

Adam

Dabbler
Joined
Jun 10, 2013
Messages
10
Hmm this is unfortunately what I feared. Luckily the data corruption is in unimportant file.

So in the mean time while I work on getting new parts for my server, what is the likelihood of the drive failing?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
There is no likelihood. The drive *is* failing. That error message popping up is your "your drive is defunct" message.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Adam:

This drive is in all sorts of bad shape. It has a ridiculous high load cycle count for a NAS drive. It's got sectors going bad. etc.

That drive is on borrowed time. YOu need to offload that data *NOW*, and you need to stop using 3-drive non-redundant arrays in ZFS. :)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
So as you can see, others have chimed in and have given you great advice, backup your data now or you have a great opportunity to loose it all.
 

Adam

Dabbler
Joined
Jun 10, 2013
Messages
10
Sorry by fail I meant is it likely to become completely inaccessible before I can back the data up (which I'm doing now)?

After doing some research on Load Cycle Count I realise that the high count is probably down to my decision to use a WD Green drive (I know not a good idea), unfortunately I'm likely to get the same drive type back on RMA (will be asking for RED drive if the let me though) is there anyway to prevent the drive heads parking so frequently with these drives?
 

Adam

Dabbler
Joined
Jun 10, 2013
Messages
10
Ok so that will work on the Green Drives, good to know.

Thank you everyone for your help, I will be setting up a much more redundant system this time.

Now onto researching my next problem, backing up jails.
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
Wdidle3 is a must to using green drives..

Sent from my SGH-I257M using Tapatalk 2
 
Status
Not open for further replies.
Top