zfs/scripts/zpool-config/lo-raid0.cfg

22 lines
527 B
Bash

#!/bin/bash
#
# 5 Device Loopback Raid-0 Configuration
#
DEVICES="/tmp/zpool-vdev0 \
/tmp/zpool-vdev1 \
/tmp/zpool-vdev2 \
/tmp/zpool-vdev3 \
/tmp/zpool-vdev4"
DEVICE_SIZE=512
for DEV in ${DEVICES}; do
msg "Creating ${DEV} loopback device (${DEVICE_SIZE} Mib)"
rm -f ${DEV} || exit 1
dd if=/dev/zero of=${DEV} bs=1024k count=${DEVICE_SIZE} &>/dev/null || exit 1
losetup `/sbin/losetup -f` ${DEV} || exit 1
done
${CMDDIR}/zpool/zpool create -f ${ZPOOL_NAME} ${DEVICES} || exit 1