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:
parent
f12971e6f5
commit
99d3ece847
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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=""
|
||||
|
||||
|
|
|
@ -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=""
|
||||
|
|
|
@ -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=""
|
||||
|
||||
|
|
|
@ -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=""
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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=""
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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=""
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue