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
|
|
|
|
|
2009-08-18 04:35:06 +00:00
|
|
|
msg ${ZPOOL} create -f ${ZPOOL_NAME} ${STRIPES[*]}
|
|
|
|
${ZPOOL} create -f ${ZPOOL_NAME} ${STRIPES[*]} || exit 1
|
2009-01-20 22:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
zpool_destroy() {
|
2009-08-18 04:35:06 +00:00
|
|
|
msg ${ZPOOL} destroy ${ZPOOL_NAME}
|
|
|
|
${ZPOOL} destroy ${ZPOOL_NAME}
|
2009-01-20 22:10:30 +00:00
|
|
|
}
|