Merge commit 'refs/top-bases/linux-zpios' into linux-zpios

This commit is contained in:
Brian Behlendorf 2009-01-16 14:00:30 -08:00
commit fc48083154
4 changed files with 14 additions and 8 deletions

View File

@ -0,0 +1,8 @@
#!/bin/bash
#
# Single disk /dev/hda Raid-0 Configuration
#
DEVICES="/dev/hda"
${CMDDIR}/zpool/zpool create -f ${ZPOOL_NAME} ${DEVICES} || exit 1

View File

@ -10,12 +10,10 @@ DEVICES="/tmp/zpool-vdev0 \
/tmp/zpool-vdev4" /tmp/zpool-vdev4"
for DEV in ${DEVICES}; do for DEV in ${DEVICES}; do
local DEV_LO=`/sbin/losetup -f`
rm -f ${DEV} || exit 1 rm -f ${DEV} || exit 1
dd if=/dev/zero of=${DEV} bs=1024k count=512 || exit 1 dd if=/dev/zero of=${DEV} bs=1024k count=512 || exit 1
losetup ${DEV_LO} ${DEV} || exit 1 losetup `/sbin/losetup -f` ${DEV} || exit 1
done done
${CMDDIR}/zpool/zpool create ${ZPOOL_NAME} ${DEVICES} || exit 1 ${CMDDIR}/zpool/zpool create -f ${ZPOOL_NAME} ${DEVICES} || exit 1

View File

@ -12,4 +12,4 @@ DEVICES="/dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf \
/dev/sdak /dev/sdal /dev/sdam /dev/sdan /dev/sdao /dev/sdap \ /dev/sdak /dev/sdal /dev/sdam /dev/sdan /dev/sdao /dev/sdap \
/dev/sdaq /dev/sdar /dev/sdas /dev/sdat /dev/sdau /dev/sdav" /dev/sdaq /dev/sdar /dev/sdas /dev/sdat /dev/sdau /dev/sdav"
${CMDDIR}/zpool/zpool create ${ZPOOL_NAME} ${DEVICES} || exit 1 ${CMDDIR}/zpool/zpool create -f ${ZPOOL_NAME} ${DEVICES} || exit 1

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
. ./common.sh . ./common.sh
PROG=create-zpool.sh PROG=zpool-create.sh
usage() { usage() {
cat << EOF cat << EOF
@ -50,7 +50,7 @@ while getopts 'hvc:p:' OPTION; do
VERBOSE=1 VERBOSE=1
;; ;;
c) c)
ZPOOL_CONFIG=${TOPDIR}/scripts/zpool-config/${OPTARG} ZPOOL_CONFIG=${TOPDIR}/scripts/zpool-config/${OPTARG}.cfg
;; ;;
p) p)
ZPOOL_NAME=${OPTARG} ZPOOL_NAME=${OPTARG}
@ -73,6 +73,6 @@ if [ ${VERBOSE} ]; then
echo echo
echo "zpool status ${ZPOOL_NAME}" echo "zpool status ${ZPOOL_NAME}"
${CMDDIR}/zpool/zpool status ${ZPOOL_NAME} || exit 1 ${CMDDIR}/zpool/zpool status ${ZPOOL_NAME} || exit 1
} fi
exit 0 exit 0