sharedvast.blogg.se

Openzfs scrub all pools
Openzfs scrub all pools










  1. #Openzfs scrub all pools how to
  2. #Openzfs scrub all pools install
  3. #Openzfs scrub all pools upgrade
  4. #Openzfs scrub all pools code

As mentioned in the introduction, LUKS, VeraCrypt, and many other schemes are available and can be layered either beneath or atop OpenZFS itself. There's more to OpenZFS native encryption than the algorithms used, though-so we'll try to give you a brief but solid grounding in the sysadmin's-eye perspective on the "why" and "what" as well as the simple "how." Why (or why not) OpenZFS native encryption?Ī clever sysadmin who wants to provide at-rest encryption doesn't actually need OpenZFS native encryption, obviously. OpenZFS' encryption algorithm defaults to either aes-256-ccm (prior to 0.8.4) or aes-256-gcm (>= 0.8.4) when encryption=on is set. This obviates the need for separate tools like LUKS, VeraCrypt, or BitLocker. First introduced in OpenZFS 0.8, native encryption allows a system administrator to transparently encrypt data at rest within ZFS itself. Simply edit /etc/zfs/zed.d/zed.rc to indicate to where the email should be sent and whether an email should be sent also if the pool is not experiencing any problems, make sure something named scrub.finish followed by anything in /etc/zfs/zed.d leads to it, and make sure zed is started on boot.One of the many features OpenZFS brings to the table is ZFS native encryption. If all you want is to receive an email when the scrub completes, the provided script will do that nicely. Examples are provided that can provide a starting point. That script can take any appropriate action, such as sending an email, writing a log entry somewhere, or making the system sing and dance (OK, maybe not that). The event daemon, by virtue of monitoring the kernel events directly, can react almost immediately to any events that take place and does not depend on continuous polling and parsing of some other command's output.Ĭreate a shell script with any file name that begins with /etc/zfs/zed.d/scrub.finish (for example, ). On ZFS On Linux, starting with version 0.6.3 this can be handled quite elegantly by using the ZFS Event Daemon (zed). Can someone suggest a lower-tech solution to the problem?

#Openzfs scrub all pools install

This particular setup is for a workstation system, so while a monitoring tool such as Nagios probably has add-ins that would solve the problem, it feels rather overkill to install such a tool for just this one task.

openzfs scrub all pools

#Openzfs scrub all pools upgrade

(It would make it almost too easy to simply cron zpool scrub -wait-until-done $POOL zpool status $POOL.)įailing that, I'd like to ask the system whether a scrub is currently in progress, preferably in a way that doesn't too much risk breaking with an upgrade or configuration change, so that I can act on whether or not a previously running scrub has finished (by executing a zpool status when the scrub status goes from scrubbing to not scrubbing). Ideally, I'd want to tell zpool scrub to not return until the scrub finishes, but I don't see any way to make it do that. Given that, the rest should fall into place. The main problem is detecting the change of status from scrubbing to finished scrubbing. The only parameter documented for zpool scrub is -s for "stop scrubbing".

#Openzfs scrub all pools code

zpool status gives me a status report and exits (with exit code 0 while the scrub is running it hasn't finished yet so I don't know if the exit status changes once it's done, but I doubt it). zpool scrub returns immediately and then the scrub is run in the background by the system (which is certainly desirable behavior if the scrub is initiated by an administrator from a terminal).

#Openzfs scrub all pools how to

The second part, I'm not quite so sure how to do. The first part is easy: just set up a cron job to run zpool scrub $POOL as root at whatever interval is reasonable in my particular situation.

openzfs scrub all pools

The purpose of this is to catch any problems without having to manually look for them (push rather than pull). I would like to use cron to schedule periodic scrubs of my ZFS pool, and at some reasonably short time after the scrub finishes, email a status report to myself.












Openzfs scrub all pools