Technology

Kickstarting with Fiber Channel Drives

One of the issues I've run into many times is when you kickstart a storage node attached to fiber channel, then it will start installing /dev/sda1 on the disk LUN. I blew away a huge storage partition by doing this on accident. Yikes! When I took my RHCE class the instructor just looked bewildered and had no idea how to solve it. The solution is obvious: Remove the drivers during the %pre script. This link shows how to do it:
%pre

#!/bin/sh

# This will remove the loaded HBA modules from the kernel
remove_qla(){
  for i in $(lsmod | grep qla | awk '{print $1'}); do
  echo Will remove: $i >> /dev/tty1
  rmmod $i
  sleep 1
  done
}

remove_lpfc(){
for i in $(lsmod | grep lpfc | awk '{print $1'}); do
  echo Will remove: $i >> /dev/tty1
  rmmod $i
  sleep 1
  done

}
remove_qla
sleep 2
remove_qla
remove_lpfc


This script comes from http://communities.vmware.com/message/1272854#1272854 5 years later, a solution emerges. Its been there all along, but nobody I knew could solve it. Many people are paranoid anyway and will not use this because like the thread states: There's nothing worse than blowing away a LUN. And yes, I've done it. At the US Army Laboratories of all places!