3 # Zpool Raid-10 Configuration
5 # This script is used to test with the /dev/disk/by-vdev/[A-Z][1-n] devices.
6 # It assumes that you have already populated /dev/disk/by-vdev/ by creating
7 # an /etc/zfs/vdev_id.conf file based on your system design.
9 # You can then use either the zpool-create.sh or the zpios.sh test script to
10 # test various Raid-10 configurations by adjusting the following tunables.
11 # For example if you wanted to create and test a single 4-disk Raid-10
12 # configuration using disks [A-D]1 with dedicated ZIL and L2ARC devices
13 # you could run the following.
15 # ZIL="log A2" L2ARC="cache B2" RANKS=1 CHANNELS=4 \
16 # zpool-create.sh -c zpool-raid10
21 # scan: none requested
24 # NAME STATE READ WRITE CKSUM
26 # mirror-0 ONLINE 0 0 0
29 # mirror-1 ONLINE 0 0 0
37 # errors: No known data errors
40 # Number of interior vdevs to create using the following rank ids.
42 RANK_LIST=( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 )
44 # Number of devices per vdev using the following channel ids.
45 CHANNELS=${CHANNELS:-8}
46 CHANNEL_LIST=( A B C D E F G H I J K L M N O P Q R S T U V W X Y Z )
48 # Create a ZIL vdev as follows.
51 # Create an L2ARC vdev as follows.
61 for (( i=0, l=0 ; i<${RANKS}; i++ )); do
64 for (( j=0, k=1; j<${CHANNELS}; j+=2,k+=2,l++ )); do
65 DISK1="${CHANNEL_LIST[$j]}${RANK}"
66 DISK2="${CHANNEL_LIST[$k]}${RANK}"
67 RAID10S[$l]="mirror ${DISK1} ${DISK2}"
75 raid10_setup ${RANKS} ${CHANNELS}
77 ZPOOL_DEVICES="${RAID10S[*]} ${ZIL} ${L2ARC}"
78 msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${ZPOOL_DEVICES}
79 ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${ZPOOL_DEVICES} || exit 1
83 msg ${ZPOOL} destroy ${ZPOOL_NAME}
84 ${ZPOOL} destroy ${ZPOOL_NAME}