Trying to write zero to sector?

Status
Not open for further replies.

nidur

Dabbler
Joined
Feb 5, 2014
Messages
27
Hi just have a quick question I was not able to find out by myself.

Im trying to fix this problem on my /dev/ada2
Code:
197 Current_Pending_Sector  0x0032  200  200  000    Old_age  Always      -      13
198 Offline_Uncorrectable  0x0030  200  200  000    Old_age  Offline      -      12


Code:
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 2  Extended offline    Completed: read failure      60%    12797        976768792


When I run the following commands I am unable to write to the sector

Code:
sysctl kern.geom.debugflags=16
dd if=/dev/zero of=/dev/ada2 bs=4096 count=1 seek=976768792 conv=noerror,sync
dd: /dev/ada2: Input/output error
1+0 records in
0+0 records out
0 bytes transferred in 0.000067 secs (0 bytes/sec)


Perhaps there are a million reasons, maybe I need to take it offline first, put it to another computer.

Just wanted to know if someone had a quick answer
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
Are you trying to clear a log or something? I don't think it's exactly "fixable" if its a pending/uncorrectable error.. Drive probably removed the sector etc for a reason.. Can you post the complete "smartctl -a" for the drives/pool in question.. More specs / details on setup etc.. Thanks,
 

nidur

Dabbler
Joined
Feb 5, 2014
Messages
27
Thank you for the reply Yatti, I'm trying to get rid of the bad sector problems on my hdd.

I found out that the problem was with writing the wrong bite size to the disk, I used this command with success removing one bad sector.
Code:
dd if=/dev/ada2 of=/dev/ada2 bs=512 count=1 iseek=976768792 oseek=976768792 conv=noerror,sync

Also I found a command that fixed one of my Offline_Uncorrectable sectors
Code:
smartctl -t offline /dev/ada2

Figured out that using this command, shows me the disk info sector size.
Code:
diskinfo -v ada2
 

nidur

Dabbler
Joined
Feb 5, 2014
Messages
27
My setup is very beginner basic, MSI P67A-GD65, i5-2500K, 8GB Corsair XMS3, Raid-z2/6x1Tb, CM Stacker

Plan is to later add another zpool of 2tb disks in raid-z2 along with more memory.
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
Hardware looks ok.. Not opimal (missing ECC ram etc) will probably burn extra power.. Clearing out smart errors isn't a good idea.. ada2 is failing smart tests etc it's time to retire it not to force it to work..
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Hardware looks ok.. Not opimal (missing ECC ram etc) will probably burn extra power.. Clearing out smart errors isn't a good idea.. ada2 is failing smart tests etc it's time to retire it not to force it to work..

QFT
 

nidur

Dabbler
Joined
Feb 5, 2014
Messages
27
Thank you both for posting your opinion, Yatti I would like to know what you mean when you say "burn extra power"

Mostly I'm trying to increase my knowledge of the smart test, and hdd's functions and so on.
I was hoping that I could make the drive remap the bad/defective sectors/blocks and it seems I am well on my way to do it. If I need I'll buy a new drive.

I probably should take the drive offline to do this properly, but I'm trying to so it while connected to the zpool and I think it might be possible that the host/Freenas is stopping some smartctl tests.

And thank you cyberjock for the newbie guide it was a very useful tool on my journey
 

nidur

Dabbler
Joined
Feb 5, 2014
Messages
27
If interested here is my smart info
Code:
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      -      122
  3 Spin_Up_Time            0x0027  131  128  021    Pre-fail  Always      -      6416
  4 Start_Stop_Count        0x0032  097  097  000    Old_age  Always      -      3455
  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  083  083  000    Old_age  Always      -      12818
10 Spin_Retry_Count        0x0032  100  100  000    Old_age  Always      -      0
11 Calibration_Retry_Count 0x0032  100  100  000    Old_age  Always      -      0
12 Power_Cycle_Count      0x0032  099  099  000    Old_age  Always      -      1737
192 Power-Off_Retract_Count 0x0032  200  200  000    Old_age  Always      -      543
193 Load_Cycle_Count        0x0032  194  194  000    Old_age  Always      -      19491
194 Temperature_Celsius    0x0022  115  104  000    Old_age  Always      -      32
196 Reallocated_Event_Count 0x0032  200  200  000    Old_age  Always      -      0
197 Current_Pending_Sector  0x0032  200  200  000    Old_age  Always      -      10
198 Offline_Uncorrectable  0x0030  200  200  000    Old_age  Offline      -      11
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
 

nidur

Dabbler
Joined
Feb 5, 2014
Messages
27
Finally the long test was happy
Code:
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed without error      00%    12832        -

But its still showing 1 pending sector
Code:
197 Current_Pending_Sector  0x0032  200  200  000    Old_age  Always      -      1
198 Offline_Uncorrectable  0x0030  200  200  000    Old_age  Offline      -      11
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
 

nidur

Dabbler
Joined
Feb 5, 2014
Messages
27
I'm unable currently to find the last pending sector and the 198 error is not going away, but my drive is online again and resilvered.

At least I learned a few commands :)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yep, and you'll see more problems in the coming weeks. And if you have a drive fail along with some bad sectors, there's a chance you'll ahve lost data. That's why once you start having problem like you are having instead of trying to rig it to look fine you should RMA or replace it. Every drive I've personally seen go bad goes from values of 0 to 1000s in just a few days/weeks. It's just prolonging the inevitable at the potential risk of your data. But good luck! You might be that 1 in 100 that gets away with it.
 

nidur

Dabbler
Joined
Feb 5, 2014
Messages
27
Thank you cyberjock for the concern, I mean it really.

I hope that the drive will deteriorate and my freenas will send me emails about it so that I can replace it one day.
My freenas is used as a backup atm so not worried about data loss that much.

Watching this smart report where should I pay attention other than, nr. 5, 197, 198
Code:
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      -      520
  3 Spin_Up_Time            0x0027  131  128  021    Pre-fail  Always      -      6425
  4 Start_Stop_Count        0x0032  097  097  000    Old_age  Always      -      3457
  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  083  083  000    Old_age  Always      -      12849
10 Spin_Retry_Count        0x0032  100  100  000    Old_age  Always      -      0
11 Calibration_Retry_Count 0x0032  100  100  000    Old_age  Always      -      0
12 Power_Cycle_Count      0x0032  099  099  000    Old_age  Always      -      1739
192 Power-Off_Retract_Count 0x0032  200  200  000    Old_age  Always      -      543
193 Load_Cycle_Count        0x0032  194  194  000    Old_age  Always      -      19514
194 Temperature_Celsius    0x0022  114  104  000    Old_age  Always      -      33
196 Reallocated_Event_Count 0x0032  200  200  000    Old_age  Always      -      0
197 Current_Pending_Sector  0x0032  200  200  000    Old_age  Always      -      1
198 Offline_Uncorrectable  0x0030  200  200  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
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Not a clue. To be blunt, your decision is so illogical to me I don't even want to continue the discussion. People go with ZFS for reliability. Then to cut corners by trying to fix errors that will no doubt get worse is completely beyond any reasoning which I understand.
 

nidur

Dabbler
Joined
Feb 5, 2014
Messages
27
Yes I agree it is illogical not to swap the drive out if reliability would be the main issue. But for me right now it's about getting to know about the software/hardware reliability before I start putting my trust in it.

Thank you again cyberjock and Yatti for the input.
 
Status
Not open for further replies.
Top