3 # A simple script to simply the loading/unloading the ZFS module stack.
5 basedir="$(dirname $0)"
7 SCRIPT_COMMON=common.sh
8 if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
9 . "${basedir}/${SCRIPT_COMMON}"
11 echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
20 $0 [hvud] [module-options]
23 Load/unload the ZFS module stack.
29 -d Save debug log on unload
32 Must be of the from module="options", for example:
34 $0 zfs="zfs_prefetch_disable=1"
35 $0 zfs="zfs_prefetch_disable=1 zfs_mdcomp_disable=1"
36 $0 spl="spl_debug_mask=0"
41 while getopts 'hvud' OPTION; do
63 if [ $(id -u) != 0 ]; then
64 die "Must run as root"
67 if [ ${UNLOAD} ]; then
70 check_modules || die "${ERROR}"