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 <ryao@gentoo.org>
Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2120
This commit is contained in:
Brian Behlendorf 2014-02-04 16:09:55 -08:00
parent f12971e6f5
commit 99d3ece847
16 changed files with 45 additions and 61 deletions

View File

@ -3,10 +3,9 @@
# 4 File Raid-0 Configuration # 4 File Raid-0 Configuration
# #
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
/tmp/zpool-vdev2 \ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
/tmp/zpool-vdev3"
zpool_create() { zpool_create() {
for FILE in ${FILES}; do for FILE in ${FILES}; do

View File

@ -3,10 +3,9 @@
# 4 File Raid-10 Configuration # 4 File Raid-10 Configuration
# #
FILES_M1="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1" FILES_M1=${FILES_M1:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1"}
FILES_M2="/tmp/zpool-vdev2 \ FILES_M2=${FILES_M2:-"$FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
/tmp/zpool-vdev3"
FILES="${FILES_M1} ${FILES_M2}" FILES="${FILES_M1} ${FILES_M2}"
zpool_create() { zpool_create() {

View File

@ -3,10 +3,9 @@
# 4 File Raid-Z Configuration # 4 File Raid-Z Configuration
# #
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
/tmp/zpool-vdev2 \ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
/tmp/zpool-vdev3"
zpool_create() { zpool_create() {
for FILE in ${FILES}; do for FILE in ${FILES}; do

View File

@ -3,10 +3,9 @@
# 4 File Raid-Z2 Configuration # 4 File Raid-Z2 Configuration
# #
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
/tmp/zpool-vdev2 \ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
/tmp/zpool-vdev3"
zpool_create() { zpool_create() {
for FILE in ${FILES}; do for FILE in ${FILES}; do

View File

@ -9,10 +9,9 @@
# <--------------------- raid0 zpool ---------------------> # <--------------------- raid0 zpool --------------------->
# #
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
/tmp/zpool-vdev2 \ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
/tmp/zpool-vdev3"
LODEVICES="" LODEVICES=""
MDDEVICES="" MDDEVICES=""

View File

@ -9,10 +9,10 @@
# <--------------------- raid10 zpool ---------------------> # <--------------------- raid10 zpool --------------------->
# #
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES_M1=${FILES_M1:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1"}
/tmp/zpool-vdev2 \ FILES_M2=${FILES_M2:-"$FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
/tmp/zpool-vdev3" FILES="${FILES_M1} ${FILES_M2}"
LODEVICES="" LODEVICES=""
MDDEVICES="" MDDEVICES=""
MDDEVICES_M1="" MDDEVICES_M1=""

View File

@ -9,10 +9,9 @@
# <--------------------- raidz zpool ---------------------> # <--------------------- raidz zpool --------------------->
# #
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
/tmp/zpool-vdev2 \ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
/tmp/zpool-vdev3"
LODEVICES="" LODEVICES=""
MDDEVICES="" MDDEVICES=""

View File

@ -9,10 +9,9 @@
# <--------------------- raidz2 zpool --------------------> # <--------------------- raidz2 zpool -------------------->
# #
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
/tmp/zpool-vdev2 \ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
/tmp/zpool-vdev3"
LODEVICES="" LODEVICES=""
MDDEVICES="" MDDEVICES=""

View File

@ -3,10 +3,9 @@
# 4 Device Loopback Raid-0 Configuration # 4 Device Loopback Raid-0 Configuration
# #
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
/tmp/zpool-vdev2 \ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
/tmp/zpool-vdev3"
DEVICES="" DEVICES=""
zpool_create() { zpool_create() {

View File

@ -3,10 +3,9 @@
# 4 Device Loopback Raid-0 Configuration # 4 Device Loopback Raid-0 Configuration
# #
FILES_M1="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1" FILES_M1=${FILES_M1:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1"}
FILES_M2="/tmp/zpool-vdev2 \ FILES_M2=${FILES_M2:-"$FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
/tmp/zpool-vdev3"
FILES="${FILES_M1} ${FILES_M2}" FILES="${FILES_M1} ${FILES_M2}"
DEVICES_M1="" DEVICES_M1=""
DEVICES_M2="" DEVICES_M2=""

View File

@ -2,11 +2,9 @@
# #
# 4 Device Loopback Raid-0 Configuration # 4 Device Loopback Raid-0 Configuration
# #
FILEDIR=${FILEDIR:-/var/tmp}
FILES="/tmp/zpool-vdev0 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
/tmp/zpool-vdev1 \ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
/tmp/zpool-vdev2 \
/tmp/zpool-vdev3"
DEVICES="" DEVICES=""
zpool_create() { zpool_create() {

View File

@ -3,10 +3,9 @@
# 4 Device Loopback Raid-0 Configuration # 4 Device Loopback Raid-0 Configuration
# #
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
/tmp/zpool-vdev2 \ $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
/tmp/zpool-vdev3"
DEVICES="" DEVICES=""
zpool_create() { zpool_create() {

View File

@ -9,9 +9,8 @@ SDHOSTS=${SDHOSTS:-1}
SDTGTS=${SDTGTS:-1} SDTGTS=${SDTGTS:-1}
SDLUNS=${SDLUNS:-1} SDLUNS=${SDLUNS:-1}
LDMOD=/sbin/modprobe LDMOD=/sbin/modprobe
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
/tmp/zpool-vdev2"
DEVICES="" DEVICES=""
zpool_create() { zpool_create() {

View File

@ -9,9 +9,8 @@ SDHOSTS=${SDHOSTS:-1}
SDTGTS=${SDTGTS:-1} SDTGTS=${SDTGTS:-1}
SDLUNS=${SDLUNS:-1} SDLUNS=${SDLUNS:-1}
LDMOD=/sbin/modprobe LDMOD=/sbin/modprobe
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
/tmp/zpool-vdev2"
DEVICES_M1="" DEVICES_M1=""
DEVICES_M2="" DEVICES_M2=""

View File

@ -9,9 +9,8 @@ SDHOSTS=${SDHOSTS:-1}
SDTGTS=${SDTGTS:-1} SDTGTS=${SDTGTS:-1}
SDLUNS=${SDLUNS:-1} SDLUNS=${SDLUNS:-1}
LDMOD=/sbin/modprobe LDMOD=/sbin/modprobe
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
/tmp/zpool-vdev2"
DEVICES="" DEVICES=""
zpool_create() { zpool_create() {

View File

@ -9,9 +9,8 @@ SDHOSTS=${SDHOSTS:-1}
SDTGTS=${SDTGTS:-1} SDTGTS=${SDTGTS:-1}
SDLUNS=${SDLUNS:-1} SDLUNS=${SDLUNS:-1}
LDMOD=/sbin/modprobe LDMOD=/sbin/modprobe
FILES="/tmp/zpool-vdev0 \ FILEDIR=${FILEDIR:-/var/tmp}
/tmp/zpool-vdev1 \ FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
/tmp/zpool-vdev2"
DEVICES="" DEVICES=""
zpool_create() { zpool_create() {