summaryrefslogtreecommitdiffstats
path: root/scripts/zpool-config
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/zpool-config')
-rw-r--r--scripts/zpool-config/file-raid0.sh4
-rw-r--r--scripts/zpool-config/file-raid10.sh34
-rw-r--r--scripts/zpool-config/file-raidz.sh31
-rw-r--r--scripts/zpool-config/file-raidz2.sh31
4 files changed, 98 insertions, 2 deletions
diff --git a/scripts/zpool-config/file-raid0.sh b/scripts/zpool-config/file-raid0.sh
index 633324821..02683fabc 100644
--- a/scripts/zpool-config/file-raid0.sh
+++ b/scripts/zpool-config/file-raid0.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# 4 Device File Raid-0 Configuration
+# 4 File Raid-0 Configuration
#
FILES="/tmp/zpool-vdev0 \
@@ -12,7 +12,7 @@ zpool_create() {
for FILE in ${FILES}; do
msg "Creating ${FILE}"
rm -f ${FILE} || exit 1
- dd if=/dev/zero of=${FILE} bs=1024k count=256 status=noxfer &>/dev/null ||
+ dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
die "Error $? creating ${FILE}"
done
diff --git a/scripts/zpool-config/file-raid10.sh b/scripts/zpool-config/file-raid10.sh
new file mode 100644
index 000000000..d3d2d82eb
--- /dev/null
+++ b/scripts/zpool-config/file-raid10.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+#
+# 4 File Raid-10 Configuration
+#
+
+FILES_M1="/tmp/zpool-vdev0 \
+ /tmp/zpool-vdev1"
+FILES_M2="/tmp/zpool-vdev2 \
+ /tmp/zpool-vdev3"
+FILES="${FILES_M1} ${FILES_M2}"
+
+zpool_create() {
+ for FILE in ${FILES}; do
+ msg "Creating ${FILE}"
+ rm -f ${FILE} || exit 1
+ dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
+ die "Error $? creating ${FILE}"
+ done
+
+ msg ${CMDDIR}/zpool/zpool create ${ZPOOL_NAME} \
+ mirror ${FILES_M1} mirror ${FILES_M2}
+ ${CMDDIR}/zpool/zpool create ${ZPOOL_NAME} \
+ mirror ${FILES_M1} mirror ${FILES_M2} || exit 1
+}
+
+zpool_destroy() {
+ msg ${CMDDIR}/zpool/zpool destroy ${ZPOOL_NAME}
+ ${CMDDIR}/zpool/zpool destroy ${ZPOOL_NAME}
+
+ for FILE in ${FILES}; do
+ msg "Removing ${FILE}"
+ rm -f ${FILE} || exit 1
+ done
+}
diff --git a/scripts/zpool-config/file-raidz.sh b/scripts/zpool-config/file-raidz.sh
new file mode 100644
index 000000000..686748907
--- /dev/null
+++ b/scripts/zpool-config/file-raidz.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# 4 File Raid-Z Configuration
+#
+
+FILES="/tmp/zpool-vdev0 \
+ /tmp/zpool-vdev1 \
+ /tmp/zpool-vdev2 \
+ /tmp/zpool-vdev3"
+
+zpool_create() {
+ for FILE in ${FILES}; do
+ msg "Creating ${FILE}"
+ rm -f ${FILE} || exit 1
+ dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
+ die "Error $? creating ${FILE}"
+ done
+
+ msg ${CMDDIR}/zpool/zpool create raidz ${ZPOOL_NAME} ${FILES}
+ ${CMDDIR}/zpool/zpool create raidz ${ZPOOL_NAME} ${FILES} || exit 1
+}
+
+zpool_destroy() {
+ msg ${CMDDIR}/zpool/zpool destroy ${ZPOOL_NAME}
+ ${CMDDIR}/zpool/zpool destroy ${ZPOOL_NAME}
+
+ for FILE in ${FILES}; do
+ msg "Removing ${FILE}"
+ rm -f ${FILE} || exit 1
+ done
+}
diff --git a/scripts/zpool-config/file-raidz2.sh b/scripts/zpool-config/file-raidz2.sh
new file mode 100644
index 000000000..09b20e4c9
--- /dev/null
+++ b/scripts/zpool-config/file-raidz2.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# 4 File Raid-Z2 Configuration
+#
+
+FILES="/tmp/zpool-vdev0 \
+ /tmp/zpool-vdev1 \
+ /tmp/zpool-vdev2 \
+ /tmp/zpool-vdev3"
+
+zpool_create() {
+ for FILE in ${FILES}; do
+ msg "Creating ${FILE}"
+ rm -f ${FILE} || exit 1
+ dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
+ die "Error $? creating ${FILE}"
+ done
+
+ msg ${CMDDIR}/zpool/zpool create raidz2 ${ZPOOL_NAME} ${FILES}
+ ${CMDDIR}/zpool/zpool create raidz2 ${ZPOOL_NAME} ${FILES} || exit 1
+}
+
+zpool_destroy() {
+ msg ${CMDDIR}/zpool/zpool destroy ${ZPOOL_NAME}
+ ${CMDDIR}/zpool/zpool destroy ${ZPOOL_NAME}
+
+ for FILE in ${FILES}; do
+ msg "Removing ${FILE}"
+ rm -f ${FILE} || exit 1
+ done
+}