Add zfs_prepare_disk script for disk firmware install

Have libzfs call a special `zfs_prepare_disk` script before a disk is
included into the pool.  The user can edit this script to add things
like a disk firmware update or a disk health check.  Use of the script
is totally optional. See the zfs_prepare_disk manpage for full details.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #15243
This commit is contained in:
Tony Hutter
2023-09-21 08:36:26 -07:00
committed by Brian Behlendorf
parent 35252ae0fd
commit 11574a7934
13 changed files with 389 additions and 38 deletions
+3
View File
@@ -9,6 +9,9 @@ dist_pkgdata_SCRIPTS = \
zloop.sh \
zfs-helpers.sh
dist_zfsexec_SCRIPTS = \
zfs_prepare_disk
EXTRA_SCRIPTS = \
commitcheck.sh \
common.sh.in \
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
#
# This is an optional helper script that is automatically called by libzfs
# before a disk is about to be added into the pool. It can be modified by
# the user to run whatever commands are necessary to prepare a disk for
# inclusion into the pool. For example, users can add lines to this
# script to do things like update the drive's firmware or check the drive's
# health. The script is optional and can be removed if it is not needed.
#
# See the zfs_prepare_disk(8) man page for details.
#
# Example:
#
# echo "Prepare disk $VDEV_PATH ($VDEV_UPATH) for $VDEV_PREPARE in $POOL_NAME"
#
exit 0