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
|
# 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
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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=""
|
||||||
|
|
||||||
|
|
|
@ -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=""
|
||||||
|
|
|
@ -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=""
|
||||||
|
|
||||||
|
|
|
@ -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=""
|
||||||
|
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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=""
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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=""
|
||||||
|
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue