2

S.M.A.R.T. has found an unrecoverable read-error on one of my disks, but zpool status lists all disks as ONLINE (I.E. not DEGRADED).

  1. Do you know why might that be? I though ZFS would know of any errors as soon as anyone...
  2. Do I need to run a scrub in order for it to recheck the status of all disks?
  3. Can I have S.M.A.R.T. automatically report to ZFS somehow?
1
  • What is the output of zpool status -v? It's possible zfs detected and repaired the error. It's also possible that zfs when attempted to write to a sector, the drive determined it couldn't, and has mapped the write somewhere else without letting zfs know. – mmusante Nov 29 '17 at 0:36
2
  1. Do you know why might that be? I though ZFS would know of any errors as soon as anyone...
  2. Do I need to run a scrub in order for it to recheck the status of all disks?
  3. Can I have S.M.A.R.T. automatically report to ZFS somehow?
  1. No, it does not check all blocks all the time, it just makes sure that each written block can be accounted for (and restored, if redundancy is available) as soon as it is needed/accessed. Empty space is not checked at all (because you don't have valuable data there, so it would be a waste of time), and normal data is only checked when it is read (as write is append-only). As mmusante correctly said, you will only get error messages if the error is critical and can not be recovered from automatically (otherwise, you just see a notice and error counts in zpool status).
  2. Yes.
  3. It may be easier to just regularly (via cronjob) scrub the pool. Common recommended times are about once a month for enterprise-quality disks and once a week for consumer-level disks. Otherwise you could start a manual scrubbing with a script from smartmontools:

    Most of the time, you only need to place a script in /etc/smartmontools/run.d/. Whenever smartd wants to send a report, it will execute smart-runner and the latter will run your script.

    You have several variables available to your script (again, see the smartd manpage). These come from a test run:

    SMARTD_MAILER=/usr/share/smartmontools/smartd-runner
    SMARTD_SUBJECT=SMART error (EmailTest) detected on host: XXXXX
    SMARTD_ADDRESS=root
    SMARTD_TFIRSTEPOCH=1267409738
    SMARTD_FAILTYPE=EmailTest
    SMARTD_TFIRST=Sun Feb 28 21:45:38 2010 VET
    SMARTD_DEVICE=/dev/sda
    SMARTD_DEVICETYPE=sat
    SMARTD_DEVICESTRING=/dev/sda
    SMARTD_FULLMESSAGE=This email was generated by the smartd daemon running on:
    SMARTD_MESSAGE=TEST EMAIL from smartd for device: /dev/sda
    

    Your script also has a temporary copy of the report available as "$1". It will be deleted after you finish but the same content is written to /var/log/syslog.

    You then just need to map from the device name to your pool (you can parse zpool status).

1
  • I think my main "issue" was that I had not run a scrub since the fault started to appear. I run scrubs once a month, but smart tests every day since they are much quicker. – lindhe Nov 30 '17 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.