2009-01-21 00:57:45 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2009-01-21 05:03:02 +00:00
|
|
|
# 4 File Raid-0 Configuration
|
2009-01-21 00:57:45 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
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
|
2009-01-21 05:03:02 +00:00
|
|
|
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
2009-01-21 00:57:45 +00:00
|
|
|
die "Error $? creating ${FILE}"
|
|
|
|
done
|
|
|
|
|
2009-10-21 18:38:51 +00:00
|
|
|
msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${FILES}
|
|
|
|
${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${FILES} || exit 1
|
2009-01-21 00:57:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
zpool_destroy() {
|
2009-08-18 04:35:06 +00:00
|
|
|
msg ${ZPOOL} destroy ${ZPOOL_NAME}
|
|
|
|
${ZPOOL} destroy ${ZPOOL_NAME}
|
2009-01-21 00:57:45 +00:00
|
|
|
|
|
|
|
for FILE in ${FILES}; do
|
|
|
|
msg "Removing ${FILE}"
|
|
|
|
rm -f ${FILE} || exit 1
|
|
|
|
done
|
|
|
|
}
|