3 # Zpool Raid-10 Configuration
5 # This script is used to simplify testing with the /dev/disk/zpool/[A-Z][1-n]
6 # devices. It assumes that you have already populated /dev/disk/zpool/ by
7 # creating an /etc/zfs/zdev.conf file based on your system design. You may
8 # use the zpool_layout command or manually create your own config file.
10 # You can then use either the zpool-create.sh or the zpios.sh test script to
11 # test various Raid-10 configurations by adjusting the following tunables.
12 # For example if you wanted to create and test a single 4-disk Raid-10
13 # configuration using disks [A-D]1 with dedicated ZIL and L2ARC devices
14 # you could run the following.
16 # ZIL="log A2" L2ARC="cache B2" RANKS=1 CHANNELS=4 \
17 # zpool-create.sh -c zpool-raid10
22 # scan: none requested
25 # NAME STATE READ WRITE CKSUM
27 # mirror-0 ONLINE 0 0 0
30 # mirror-1 ONLINE 0 0 0
38 # errors: No known data errors
41 # Number of interior vdevs to create using the following rank ids.
43 RANK_LIST=( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 )
45 # Number of devices per vdev using the following channel ids.
46 CHANNELS=${CHANNELS:-8}
47 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 )
49 # Create a ZIL vdev as follows.
52 # Create an L2ARC vdev as follows.
62 for (( i=0, l=0 ; i<${RANKS}; i++ )); do
65 for (( j=0, k=1; j<${CHANNELS}; j+=2,k+=2,l++ )); do
66 DISK1="${CHANNEL_LIST[$j]}${RANK}"
67 DISK2="${CHANNEL_LIST[$k]}${RANK}"
68 RAID10S[$l]="mirror ${DISK1} ${DISK2}"
76 raid10_setup ${RANKS} ${CHANNELS}
78 ZPOOL_DEVICES="${RAID10S[*]} ${ZIL} ${L2ARC}"
79 msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${ZPOOL_DEVICES}
80 ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${ZPOOL_DEVICES} || exit 1
84 msg ${ZPOOL} destroy ${ZPOOL_NAME}
85 ${ZPOOL} destroy ${ZPOOL_NAME}