Two Questions - ZFS Logical Sector Size & Currently Unreadable (Pending) Sectors

Status
Not open for further replies.

TrevorX

Explorer
Joined
Mar 10, 2015
Messages
77
Hello,

I have a couple of questions. Firstly, I was of the understanding/belief that ZFS creates ZPools with 4096 bytes sector size by default, but I've just discovered that my array consisting of six HGST 6TB NAS drives is reporting 4096 bytes physical, but 512 bytes logical sector size. This is obviously sub-optimal and a little confusing. So I thought I'd ask:

1) Why would this be happening?
2) What will be the impact of leaving it as is? I realise the only way to fix it will be to rebuild the ZPool, and as I have around 12TB of data on there that's not really an option.
3) Even if I did decide to rebuild the ZPool, how would I ensure that it wouldn't create 512 byte sector size again, given that it shouldn't be able to do this anyway?

Investigating my second question is what led me to the discovery of the above issue. FreeNAS is reporting 8 currently unreadable sectors on one of its drives (/dev/ada7). But I've run through a long SMART test (smartctl -t long /dev/ada7) and it shows zero errors. So now what do I do? Pull the drive and manually secure erase it?

Thanks for your help,

Trevor
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
Firstly, I was of the understanding/belief that ZFS creates ZPools with 4096 bytes sector size by default, but I've just discovered that my array consisting of six HGST 6TB NAS drives is reporting 4096 bytes physical, but 512 bytes logical sector size. This is obviously sub-optimal and a little confusing.
First make sure that the problem really exist, and it is not just your confusion, since FreeNAS should do things right by itself, unless this pool was created years ago. Run `zdb <pool_name>|grep ashift` and see what values it report. If it report 12 then everything is fine, if 9 then "Houston, we have a problem".

FreeNAS is reporting 8 currently unreadable sectors on one of its drives (/dev/ada7). But I've run through a long SMART test (smartctl -t long /dev/ada7) and it shows zero errors. So now what do I do? Pull the drive and manually secure erase it?
Unreadable sectors are usually reported by SMART (if I correctly understood what are you talking about). In that case yes, I would guess full erase could help, though pulling drive out is not required for that.
 

TrevorX

Explorer
Joined
Mar 10, 2015
Messages
77
Thanks for your reply Mav. I've run the ashift query on the ZPool and it does, indeed, return 12, not 9. But that's at the ZPool level, isn't it? What about at the disk level? Why would smartcrl be reporting 512 byte logical sector size at the disk level?

Regarding the SMART error, I am getting an error reported and flagged by FreeNAS that says the following:
CRITICAL: Device: /dev/ada7, 8 Currently unreadable (pending) sectors

Now I've run through a long SMART test using the command "smartctl -t long /dev/ada7", but that didn't even *find* any errors. Despite that, FreeNAS is still showing the same error. So I pulled the drive, plugged it into another box, booted up Parted Magic and used the Secure Erase command to use the drive's internal Secure Erase process to completely wipe the drive. After plugging it back in, however, FreeNAS is still reporting the same error. Which shouldn't be possible, because Secure Erase writes to every single sector of the drive, which would cause the firmware to remap any faulty sectors.

My usual trouble-shooting logic suggests to follow the path of most likely cause, which in this case suggests the most likely source is either A) FreeNAS is misreporting the error, or B) it is incorrectly reporting the disk (ie saying it is ata7 when it might actually be ata1 to ata6). At this point I think I need to check SMART on each drive and go from there. Any thoughts?

Thanks again,

Trevor
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
I've run the ashift query on the ZPool and it does, indeed, return 12, not 9. But that's at the ZPool level, isn't it? What about at the disk level? Why would smartcrl be reporting 512 byte logical sector size at the disk level?

At the disk level things are exactly as they are reported by smartctl -- disk has 4KB physical sectors and 512B emulated logical sectors. There is no problem. While disks with 4KB logical sector exist in theory, they are not widely present on retail market. Since ZFS knows about the 4KB nature of the drive, it sends to disk requests that are multiple to 4KB, so disk can execute them in efficient way.

So I pulled the drive, plugged it into another box, booted up Parted Magic and used the Secure Erase command to use the drive's internal Secure Erase process to completely wipe the drive. After plugging it back in, however, FreeNAS is still reporting the same error. Which shouldn't be possible, because Secure Erase writes to every single sector of the drive, which would cause the firmware to remap any faulty sectors.

I have two more simple guesses:
- either SMART of the disk still reports those statuses (you may check that with `smartctl -a /dev/daX`, looking for non-zero values for parameters 197 and 198);
- or FreeNAS caches the status somewhere. Though I am not sure where, so you may try to reboot it, that I guess may help.
 

TrevorX

Explorer
Joined
Mar 10, 2015
Messages
77
smartctl -a /dev/ada7 showing zero errors:

196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age Always - 0

I just ran that command against every drive in the pool and got the same result for each - zero errors.

I have rebooted the NAS about a dozen times in the past few days fiddling with various things, so whatever is causing this it isn't something that can be flushed that easily.
 

TrevorX

Explorer
Joined
Mar 10, 2015
Messages
77
Code:
[root@XNAS] ~# smartctl -a /dev/ada7
smartctl 6.3 2014-07-26 r3976 [FreeBSD 9.3-RELEASE-p31 amd64] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     HGST Deskstar NAS
Device Model:     HGST HDN726060ALE610
Serial Number:    NAGXXXXX
LU WWN Device Id: 5 000cca 242c23aba
Firmware Version: APGNT517
User Capacity:    6,001,175,126,016 bytes [6.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    7200 rpm
Form Factor:      3.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Tue Mar 22 16:09:25 2016 AWST
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:                (  113) seconds.
Offline data collection
capabilities:                    (0x5b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        No 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:        ( 780) minutes.
SCT capabilities:              (0x003d) 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     0x000b   100   100   016    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   137   137   054    Pre-fail  Offline      -       104
  3 Spin_Up_Time            0x0007   132   132   024    Pre-fail  Always       -       499 (Average 499)
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       69
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   140   140   020    Pre-fail  Offline      -       15
  9 Power_On_Hours          0x0012   099   099   000    Old_age   Always       -       8181
10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       62
192 Power-Off_Retract_Count 0x0032   098   098   000    Old_age   Always       -       3220
193 Load_Cycle_Count        0x0012   098   098   000    Old_age   Always       -       3220
194 Temperature_Celsius     0x0002   115   115   000    Old_age   Always       -       52 (Min/Max 22/60)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       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  Short offline       Completed without error       00%      8154         -
# 2  Extended offline    Completed without error       00%      8152         -

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.


Note: Temps at 52°C at the moment as it is resilvering. Usually around 48°C (about 20°C above ambient). Has peaked at 60°C because original HDD enclosure had insufficient cooling, hence my rebuild.
 
Last edited:

Mirfster

Doesn't know what he's talking about
Joined
Oct 2, 2015
Messages
3,215
From a quick glance, it looks pretty much okay. Only concern I see is the temperature (52 C) is pretty warm. Can you make sure that it is the same id (ada7) that is showing the errors? Also, when is the last time you ran a scrub?
 

TrevorX

Explorer
Joined
Mar 10, 2015
Messages
77
Scrubs run every fourth Sunday morning/Saturday night at midnight. The last one was almost exactly a month ago, so having it offline this weekend has probably interrupted things there.

Sorry, you posted while I was editing the above, where I mention temps. There isn't really much more I can do about temps other than replacing the fan in the drive hotswap enclosure with a high RPM version - even with the enclosures completely removed from the chassis I see no changes in average temps. I think these drives might just run a little hot.

The other option is adding a SSD for the system dataset so the zpool can get a rest - as it is they never spin down as long as the NAS is powered on. I do have two mirrored SSDs for the FreeNAS OS, but I've been worried about moving that over to them due to there being a greater likelihood of corruption (two mirrored drives vs RAIDZ2, obviously the zpool wins hands down, but the question is is there enough risk of failure/corruption of the system dataset running on the SSDs that it should be avoided, or is the risk extremely low?). Seems a bit of a waste to add another couple of SSDs just for the dataset... Will get zero benefit having a ZIL and L2ARC on SSDs as not running VMs or anything requiring lots of random access performance.
 

TrevorX

Explorer
Joined
Mar 10, 2015
Messages
77
FreeNASPendingSectorError.png


I can confirm that /dev/ada7's serial number correlates to the serial listed under ada7 of the View Disks tab of the Storage manager in FreeNAS. So everything does appear to be talking about exactly the same drive. It's just that I can't find any errors on the drive, nor can I figure out how to clear the error if it is misreporting.

Is this starting to sound like something that needs to be escalated to the bug reporting system?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Clear the error and see if it comes back. You have lots of issues you should fix though starting with temperatures. Drives should stay under 40C under max load. Your drives idle at way over that and cook when doing a resolved.
 

TrevorX

Explorer
Joined
Mar 10, 2015
Messages
77
Clear the error and see if it comes back.
That's kind of what I'm trying to figure out how to do - how do I go about doing that?

You have lots of issues you should fix though starting with temperatures. Drives should stay under 40C under max load. Your drives idle at way over that and cook when doing a resolved.
Under 40°C under max load? Fan cooled? Tell you what, I'll pull all six drives out of the chassis and run them bare on the table with fans blowing over them and see what the absolute minimum temps I can get out of them during sustained writes. I'll be interested to see the results! That will give me a good baseline from which to work.
What other suggestions do you have for me to fix my numerous errors?
Thanks for taking the time to add your input :smile:
 

TrevorX

Explorer
Joined
Mar 10, 2015
Messages
77
Wonder if something else is failing that may be the "root" cause of both issues?
Yeah not sure at this point. It could still be coincidence - I could have looked into the shutdown issue months ago if I'd known about it, but this is the first chance I've had to look into the sector error message which has made the reboot issue more obvious. Hopefully if I can determine the root cause of each then I'll have some concrete knowledge from which to draw further conclusions.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
That's kind of what I'm trying to figure out how to do - how do I go about doing that?
Uncheck the checkbox in the popup in the GUI.
Secure Erase writes to every single sector of the drive, which would cause the firmware to remap any faulty sectors.
This is a common misconception. If a write to a pending sector succeeds, that sector is taken off the pending list. Only a failed write results in a remap.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You can remove the error message by deleting the file /tmp/.smartalert. :)

Secret trick. Shh... our secret!
 

TrevorX

Explorer
Joined
Mar 10, 2015
Messages
77
Uncheck the checkbox in the popup in the GUI.
Yeah I tried that, it doesn't do anything... There is no 'Ok' button, the only way to close that popup screen is to hit the 'X' at the top right corner, but the error stays there regardless. It is persistent through reboots, too :-/

This is a common misconception. If a write to a pending sector succeeds, that sector is taken off the pending list. Only a failed write results in a remap.
Ah yes, sorry, I was unclear in what I typed. Writing to a sector with an error will cause the firmware to map that sector out and replace it with one of the reserve sectors. I didn't realise that pending sector errors could be false alarms and would be cleared off the drive's error log, though - that's good to know, thanks :smile:
 

TrevorX

Explorer
Joined
Mar 10, 2015
Messages
77
You can remove the error message by deleting the file /tmp/.smartalert. :)

Secret trick. Shh... our secret!
Thanks so much CJ, I can finally get rid of it! Very much appreciated :smile:
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
:D

Being on the dark side of things I know little ins-and-outs.

Hopefully I can share more in the future. ;)
 

TrevorX

Explorer
Joined
Mar 10, 2015
Messages
77
:D

Being on the dark side of things I know little ins-and-outs.

Hopefully I can share more in the future. ;)
Thanks CJ, your assistance is, as always, extremely appreciated :smile:
 
Status
Not open for further replies.
Top