3 # Zpool Raid-Z 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-Z configurations by adjusting the following tunables.
11 # For example if you wanted to create and test a single 4-disk Raid-Z2
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 LEVEL=2 \
16 # zpool-create.sh -c zpool-raidz
21 # scan: none requested
24 # NAME STATE READ WRITE CKSUM
26 # raidz2-0 ONLINE 0 0 0
36 # errors: No known data errors
39 # Number of interior vdevs to create using the following rank ids.
41 RANK_LIST=( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 )
43 # Number of devices per vdev using the following channel ids.
44 CHANNELS=${CHANNELS:-8}
45 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 )
47 # Raid-Z Level: 1, 2, or 3.
50 # Create a ZIL vdev as follows.
53 # Create an L2ARC vdev as follows.
62 for (( i=0; i<${RANKS}; i++ )); do
64 RAIDZ=("raidz${LEVEL}")
66 for (( j=0, k=1; j<${CHANNELS}; j++, k++ )); do
67 RAIDZ[$k]="${CHANNEL_LIST[$j]}${RANK}"
70 RAIDZS[$i]="${RAIDZ[*]}"
77 raidz_setup ${RANKS} ${CHANNELS}
79 ZPOOL_DEVICES="${RAIDZS[*]} ${ZIL} ${L2ARC}"
80 msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${ZPOOL_DEVICES}
81 ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${ZPOOL_DEVICES} || exit 1
85 msg ${ZPOOL} destroy ${ZPOOL_NAME}
86 ${ZPOOL} destroy ${ZPOOL_NAME}