summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2014-02-04 16:09:55 -0800
committerBrian Behlendorf <[email protected]>2014-02-12 09:37:46 -0800
commit99d3ece84797086407fbb4d94d3817f2dc891af0 (patch)
treea57d55eb41b30f48bb0648f2b4abb2d3ca308d2c /scripts
parentf12971e6f5cf0e84e385eb9636fbe2ae313ab257 (diff)
Add default FILEDIR path to zpool-config scripts
Allow the caller of the zpool-create.sh script to override the default path where file vdevs are created. This allows for greated flexibilty when scripting. Additionally, update the default path from /tmp/ to /var/tmp/ because these days /tmp/ is likely a ramdisk. Even though these files are sparse they may grow large in which case they should be backed by a physical device. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2120
Diffstat (limited to 'scripts')
-rw-r--r--scripts/zpool-config/file-raid0.sh7
-rw-r--r--scripts/zpool-config/file-raid10.sh7
-rw-r--r--scripts/zpool-config/file-raidz.sh7
-rw-r--r--scripts/zpool-config/file-raidz2.sh7
-rw-r--r--scripts/zpool-config/lo-faulty-raid0.sh7
-rw-r--r--scripts/zpool-config/lo-faulty-raid10.sh8
-rw-r--r--scripts/zpool-config/lo-faulty-raidz.sh7
-rw-r--r--scripts/zpool-config/lo-faulty-raidz2.sh7
-rw-r--r--scripts/zpool-config/lo-raid0.sh7
-rw-r--r--scripts/zpool-config/lo-raid10.sh7
-rw-r--r--scripts/zpool-config/lo-raidz.sh8
-rw-r--r--scripts/zpool-config/lo-raidz2.sh7
-rw-r--r--scripts/zpool-config/scsi_debug-raid0.sh5
-rw-r--r--scripts/zpool-config/scsi_debug-raid10.sh5
-rw-r--r--scripts/zpool-config/scsi_debug-raidz.sh5
-rw-r--r--scripts/zpool-config/scsi_debug-raidz2.sh5
16 files changed, 45 insertions, 61 deletions
diff --git a/scripts/zpool-config/file-raid0.sh b/scripts/zpool-config/file-raid0.sh
index 5ec80b05c..ff118361c 100644
--- a/scripts/zpool-config/file-raid0.sh
+++ b/scripts/zpool-config/file-raid0.sh
@@ -3,10 +3,9 @@
# 4 File Raid-0 Configuration
#
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2 \
- /tmp/zpool-vdev3"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
+ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
zpool_create() {
for FILE in ${FILES}; do
diff --git a/scripts/zpool-config/file-raid10.sh b/scripts/zpool-config/file-raid10.sh
index ae7f0ae07..fa297b424 100644
--- a/scripts/zpool-config/file-raid10.sh
+++ b/scripts/zpool-config/file-raid10.sh
@@ -3,10 +3,9 @@
# 4 File Raid-10 Configuration
#
-FILES_M1="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1"
-FILES_M2="/tmp/zpool-vdev2 \
- /tmp/zpool-vdev3"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES_M1=${FILES_M1:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1"}
+FILES_M2=${FILES_M2:-"$FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
FILES="${FILES_M1} ${FILES_M2}"
zpool_create() {
diff --git a/scripts/zpool-config/file-raidz.sh b/scripts/zpool-config/file-raidz.sh
index 5b6c3ea2c..768e3de89 100644
--- a/scripts/zpool-config/file-raidz.sh
+++ b/scripts/zpool-config/file-raidz.sh
@@ -3,10 +3,9 @@
# 4 File Raid-Z Configuration
#
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2 \
- /tmp/zpool-vdev3"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
+ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
zpool_create() {
for FILE in ${FILES}; do
diff --git a/scripts/zpool-config/file-raidz2.sh b/scripts/zpool-config/file-raidz2.sh
index bc0e5ec8a..b1c18f457 100644
--- a/scripts/zpool-config/file-raidz2.sh
+++ b/scripts/zpool-config/file-raidz2.sh
@@ -3,10 +3,9 @@
# 4 File Raid-Z2 Configuration
#
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2 \
- /tmp/zpool-vdev3"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
+ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
zpool_create() {
for FILE in ${FILES}; do
diff --git a/scripts/zpool-config/lo-faulty-raid0.sh b/scripts/zpool-config/lo-faulty-raid0.sh
index 10b8f88bc..bf057bba1 100644
--- a/scripts/zpool-config/lo-faulty-raid0.sh
+++ b/scripts/zpool-config/lo-faulty-raid0.sh
@@ -9,10 +9,9 @@
# <--------------------- raid0 zpool --------------------->
#
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2 \
- /tmp/zpool-vdev3"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
+ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
LODEVICES=""
MDDEVICES=""
diff --git a/scripts/zpool-config/lo-faulty-raid10.sh b/scripts/zpool-config/lo-faulty-raid10.sh
index ef81abb9d..0a3720ae1 100644
--- a/scripts/zpool-config/lo-faulty-raid10.sh
+++ b/scripts/zpool-config/lo-faulty-raid10.sh
@@ -9,10 +9,10 @@
# <--------------------- raid10 zpool --------------------->
#
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2 \
- /tmp/zpool-vdev3"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES_M1=${FILES_M1:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1"}
+FILES_M2=${FILES_M2:-"$FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
+FILES="${FILES_M1} ${FILES_M2}"
LODEVICES=""
MDDEVICES=""
MDDEVICES_M1=""
diff --git a/scripts/zpool-config/lo-faulty-raidz.sh b/scripts/zpool-config/lo-faulty-raidz.sh
index 2f1f08aa6..07fd14559 100644
--- a/scripts/zpool-config/lo-faulty-raidz.sh
+++ b/scripts/zpool-config/lo-faulty-raidz.sh
@@ -9,10 +9,9 @@
# <--------------------- raidz zpool --------------------->
#
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2 \
- /tmp/zpool-vdev3"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
+ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
LODEVICES=""
MDDEVICES=""
diff --git a/scripts/zpool-config/lo-faulty-raidz2.sh b/scripts/zpool-config/lo-faulty-raidz2.sh
index 2522fa7e7..4456a56e2 100644
--- a/scripts/zpool-config/lo-faulty-raidz2.sh
+++ b/scripts/zpool-config/lo-faulty-raidz2.sh
@@ -9,10 +9,9 @@
# <--------------------- raidz2 zpool -------------------->
#
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2 \
- /tmp/zpool-vdev3"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
+ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
LODEVICES=""
MDDEVICES=""
diff --git a/scripts/zpool-config/lo-raid0.sh b/scripts/zpool-config/lo-raid0.sh
index f24050f46..1f23fe1ff 100644
--- a/scripts/zpool-config/lo-raid0.sh
+++ b/scripts/zpool-config/lo-raid0.sh
@@ -3,10 +3,9 @@
# 4 Device Loopback Raid-0 Configuration
#
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2 \
- /tmp/zpool-vdev3"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
+ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
DEVICES=""
zpool_create() {
diff --git a/scripts/zpool-config/lo-raid10.sh b/scripts/zpool-config/lo-raid10.sh
index f9fe3c064..18c1dcbfd 100644
--- a/scripts/zpool-config/lo-raid10.sh
+++ b/scripts/zpool-config/lo-raid10.sh
@@ -3,10 +3,9 @@
# 4 Device Loopback Raid-0 Configuration
#
-FILES_M1="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1"
-FILES_M2="/tmp/zpool-vdev2 \
- /tmp/zpool-vdev3"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES_M1=${FILES_M1:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1"}
+FILES_M2=${FILES_M2:-"$FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
FILES="${FILES_M1} ${FILES_M2}"
DEVICES_M1=""
DEVICES_M2=""
diff --git a/scripts/zpool-config/lo-raidz.sh b/scripts/zpool-config/lo-raidz.sh
index db5de7c1b..483baf7b8 100644
--- a/scripts/zpool-config/lo-raidz.sh
+++ b/scripts/zpool-config/lo-raidz.sh
@@ -2,11 +2,9 @@
#
# 4 Device Loopback Raid-0 Configuration
#
-
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2 \
- /tmp/zpool-vdev3"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
+ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
DEVICES=""
zpool_create() {
diff --git a/scripts/zpool-config/lo-raidz2.sh b/scripts/zpool-config/lo-raidz2.sh
index 53a032ec5..ea52236d3 100644
--- a/scripts/zpool-config/lo-raidz2.sh
+++ b/scripts/zpool-config/lo-raidz2.sh
@@ -3,10 +3,9 @@
# 4 Device Loopback Raid-0 Configuration
#
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2 \
- /tmp/zpool-vdev3"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
+ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
DEVICES=""
zpool_create() {
diff --git a/scripts/zpool-config/scsi_debug-raid0.sh b/scripts/zpool-config/scsi_debug-raid0.sh
index 797ea8019..fc0979817 100644
--- a/scripts/zpool-config/scsi_debug-raid0.sh
+++ b/scripts/zpool-config/scsi_debug-raid0.sh
@@ -9,9 +9,8 @@ SDHOSTS=${SDHOSTS:-1}
SDTGTS=${SDTGTS:-1}
SDLUNS=${SDLUNS:-1}
LDMOD=/sbin/modprobe
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
DEVICES=""
zpool_create() {
diff --git a/scripts/zpool-config/scsi_debug-raid10.sh b/scripts/zpool-config/scsi_debug-raid10.sh
index 4ec205b8b..3c1f73360 100644
--- a/scripts/zpool-config/scsi_debug-raid10.sh
+++ b/scripts/zpool-config/scsi_debug-raid10.sh
@@ -9,9 +9,8 @@ SDHOSTS=${SDHOSTS:-1}
SDTGTS=${SDTGTS:-1}
SDLUNS=${SDLUNS:-1}
LDMOD=/sbin/modprobe
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
DEVICES_M1=""
DEVICES_M2=""
diff --git a/scripts/zpool-config/scsi_debug-raidz.sh b/scripts/zpool-config/scsi_debug-raidz.sh
index c811a0182..54a456524 100644
--- a/scripts/zpool-config/scsi_debug-raidz.sh
+++ b/scripts/zpool-config/scsi_debug-raidz.sh
@@ -9,9 +9,8 @@ SDHOSTS=${SDHOSTS:-1}
SDTGTS=${SDTGTS:-1}
SDLUNS=${SDLUNS:-1}
LDMOD=/sbin/modprobe
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
DEVICES=""
zpool_create() {
diff --git a/scripts/zpool-config/scsi_debug-raidz2.sh b/scripts/zpool-config/scsi_debug-raidz2.sh
index 429a84143..fa6e77a09 100644
--- a/scripts/zpool-config/scsi_debug-raidz2.sh
+++ b/scripts/zpool-config/scsi_debug-raidz2.sh
@@ -9,9 +9,8 @@ SDHOSTS=${SDHOSTS:-1}
SDTGTS=${SDTGTS:-1}
SDLUNS=${SDLUNS:-1}
LDMOD=/sbin/modprobe
-FILES="/tmp/zpool-vdev0 \
- /tmp/zpool-vdev1 \
- /tmp/zpool-vdev2"
+FILEDIR=${FILEDIR:-/var/tmp}
+FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
DEVICES=""
zpool_create() {