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"
40 while getopts 'hvud' OPTION
; do
62 if [ $
(id
-u) != 0 ]; then
63 die
"Must run as root"
66 if [ ${UNLOAD} ]; then
73 check_modules || die
"${ERROR}"
74 load_modules
"$@" || die
"Failed to load modules"
75 wait_udev
/dev
/zfs
30 || die
"'/dev/zfs' was not created"