# Read all drives in pool into a file first, extracting just the WWNs of the drives.
# In this example we are using p01 as pool name and assuming disks havin names starting
# with c0t5000.
# zpool status p01|awk '/c0t5000/ {print $1}' > disks
# Next, print only the first device from each mirror:
# awk '{if(NR%2==1) {print $0}}' disks > p01-first-half.txt
# Then, print only the second device from each mirror:
# awk '{if(NR%2==0) {print $0}}' disks > p01-second-half.txt
while read line; do
zpool offline poolB ${line} ;
sleep 2 ;
rtdmgr -confirm -flashlsi \
Firmware/Xyratex/XRBA_x006_MuskiePlus_SAS.lod /dev/rdsk/${line}s0 ;
sleep 5 ; zpool online poolB ${line} ; sleep 2 ;
done < /root/poolB-second-half.txt