3 # Zpool Raid-Z 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-Z configurations by adjusting the following tunables.
12 # For example if you wanted to create and test a single 4-disk Raid-Z2
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 LEVEL=2 \
17 # zpool-create.sh -c zpool-raidz
22 # scan: none requested
25 # NAME STATE READ WRITE CKSUM
27 # raidz2-0 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 # Raid-Z Level: 1, 2, or 3.
51 # Create a ZIL vdev as follows.
54 # Create an L2ARC vdev as follows.
63 for (( i=0; i<${RANKS}; i++ )); do
65 RAIDZ=("raidz${LEVEL}")
67 for (( j=0, k=1; j<${CHANNELS}; j++, k++ )); do
68 RAIDZ[$k]="${CHANNEL_LIST[$j]}${RANK}"
71 RAIDZS[$i]="${RAIDZ[*]}"
78 raidz_setup ${RANKS} ${CHANNELS}
80 ZPOOL_DEVICES="${RAIDZS[*]} ${ZIL} ${L2ARC}"
81 msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${ZPOOL_DEVICES}
82 ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${ZPOOL_DEVICES} || exit 1
86 msg ${ZPOOL} destroy ${ZPOOL_NAME}
87 ${ZPOOL} destroy ${ZPOOL_NAME}