]> granicus.if.org Git - zfs/blob - scripts/zpool-config/file-raid0.sh
Minimal libshare infrastructure
[zfs] / scripts / zpool-config / file-raid0.sh
1 #!/bin/bash
2 #
3 # 4 File Raid-0 Configuration
4 #
5
6 FILES="/tmp/zpool-vdev0  \
7        /tmp/zpool-vdev1  \
8        /tmp/zpool-vdev2  \
9        /tmp/zpool-vdev3"
10
11 zpool_create() {
12         for FILE in ${FILES}; do
13                 msg "Creating ${FILE}"
14                 rm -f ${FILE} || exit 1
15                 dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
16                         &>/dev/null || die "Error $? creating ${FILE}"
17         done
18
19         msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${FILES}
20         ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${FILES} || exit 1
21 }
22
23 zpool_destroy() {
24         msg ${ZPOOL} destroy ${ZPOOL_NAME}
25         ${ZPOOL} destroy ${ZPOOL_NAME}
26
27         for FILE in ${FILES}; do
28                 msg "Removing ${FILE}"
29                 rm -f ${FILE} || exit 1
30         done
31 }