2009-01-16 20:53:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Sun Fire x4550 (Thumper) Raid-0 Configuration
|
|
|
|
#
|
|
|
|
|
2009-02-06 19:47:09 +00:00
|
|
|
DEVICES=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000`)
|
|
|
|
|
|
|
|
S_IDX=0
|
|
|
|
STRIPES=()
|
2009-01-16 20:53:12 +00:00
|
|
|
|
2009-01-20 22:10:30 +00:00
|
|
|
zpool_create() {
|
2009-02-06 19:47:09 +00:00
|
|
|
|
|
|
|
while [ ${S_IDX} -lt ${#DEVICES[@]} ]; do
|
|
|
|
STRIPE=`readlink -f ${DEVICES[${S_IDX}]}`
|
|
|
|
STRIPES[${S_IDX}]="${STRIPE}"
|
|
|
|
let S_IDX=S_IDX+1
|
|
|
|
done
|
|
|
|
|
|
|
|
msg ${CMDDIR}/zpool/zpool create -f ${ZPOOL_NAME} ${STRIPES[*]}
|
|
|
|
${CMDDIR}/zpool/zpool create -f ${ZPOOL_NAME} ${STRIPES[*]} || exit 1
|
2009-01-20 22:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
zpool_destroy() {
|
2009-01-20 23:34:38 +00:00
|
|
|
msg ${CMDDIR}/zpool/zpool destroy ${ZPOOL_NAME}
|
2009-01-20 22:10:30 +00:00
|
|
|
${CMDDIR}/zpool/zpool destroy ${ZPOOL_NAME}
|
|
|
|
}
|