From 8a119a354a3ce65ceb44afa048ee38ffcd5afe7c Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 23 Oct 2009 11:56:15 -0700 Subject: [PATCH] Add -f force option to zpios.sh it is passed on to zpool-create.sh --- scripts/zpios.sh | 14 ++++++++++---- scripts/zpool-create.sh | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/zpios.sh b/scripts/zpios.sh index 6e9b3f50d5..8a99a395ce 100755 --- a/scripts/zpios.sh +++ b/scripts/zpios.sh @@ -31,6 +31,7 @@ DESCRIPTION: OPTIONS: -h Show this message -v Verbose + -f Force everything -p Enable profiling -c Zpool configuration -t Zpios test @@ -171,7 +172,7 @@ ZPIOS_OPTIONS= ZPOOL_OPTIONS="" ZFS_OPTIONS="" -while getopts 'hvpc:t:o:l:s:' OPTION; do +while getopts 'hvfpc:t:o:l:s:' OPTION; do case $OPTION in h) usage @@ -181,6 +182,10 @@ while getopts 'hvpc:t:o:l:s:' OPTION; do VERBOSE=1 VERBOSE_FLAG="-v" ;; + f) + FORCE=1 + FORCE_FLAG="-f" + ;; p) PROFILE=1 ;; @@ -235,7 +240,8 @@ if [ ${VERBOSE} ]; then fi # Create the zpool configuration -${ZPOOL_CREATE_SH} ${VERBOSE_FLAG} -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} \ +${ZPOOL_CREATE_SH} ${VERBOSE_FLAG} ${FORCE_FLAG} \ + -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} \ -l "${ZPOOL_OPTIONS}" -s "${ZFS_OPTIONS}" || exit 1 if [ ${PROFILE} ]; then @@ -254,8 +260,8 @@ if [ ${VERBOSE} ]; then fi # Destroy the zpool configuration -${ZPOOL_CREATE_SH} ${VERBOSE_FLAG} -p ${ZPOOL_NAME} \ - -c ${ZPOOL_CONFIG} -d || exit 1 +${ZPOOL_CREATE_SH} ${VERBOSE_FLAG} ${FORCE_FLAG} \ + -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} -d || exit 1 # Unload the test module stack and wait for device removal unload_modules diff --git a/scripts/zpool-create.sh b/scripts/zpool-create.sh index 2853f7d4e2..fa33a17726 100755 --- a/scripts/zpool-create.sh +++ b/scripts/zpool-create.sh @@ -22,10 +22,10 @@ DESCRIPTION: OPTIONS: -h Show this message -v Verbose + -f Force everything -c Configuration for zpool -p Name for zpool -d Destroy zpool (default create) - -f Force everything -l Additional zpool options -s Additional zfs options