Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk

This commit is contained in:
Brian Behlendorf 2009-01-20 21:09:46 -08:00
commit 7c60812725
5 changed files with 102 additions and 3 deletions

View File

@ -3,5 +3,8 @@ EXTRA_DIST = common.sh zfs-update.sh zfs.sh zpool-create.sh
check:
./zfs.sh -v
./zpios.sh -c file-raid0 -t tiny -v
./zpios.sh -c file-raid0 -t tiny
./zpios.sh -c file-raid10 -t tiny
./zpios.sh -c file-raidz -t tiny
./zpios.sh -c file-raidz2 -t tiny
./zfs.sh -vu

View File

@ -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

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}