Automating storcli to mirror C-series SSD on LSI Software MegaRAID in a CentOS 6.x Live CD Image

Document created by marossne on May 6, 2016Last modified by marossne on May 6, 2016
Version 10Show Document
  • View in full screen mode

[ Software links provided within have been tested for LiveCD and CentOS build environments CentOS 6.5 and CentOS 6.4]

 

For those who have an existing Live CD build Environment, tools, and kickstart config file for LiveCD on an existing CentOS/RHEL.

    1. Go the following page and grab the zip file:

               SWRAIDFILES.zip

               When unzipped, it is already indexed as a CentOS repository that contains   the

       megasr driver      RPM  and the storcli software RPM – it also contains a

                 boot  script    makeswraidmirror    that will be integrated into the LiveCD

                 to make the LSI software RAID1 device


               In your build environment:

          1.    mkdir /root/SWRAID
          2.        move/copy  the downloaded zip file to /root/SWRAID
          3.        unzip the zip file

If you want to use a different directory to hold the zip contents, just change the

references to /root/SWRAID in the config file modification instructions below.



          2. Examine the makeswraidmirror   file. You will note that it proves

              output to /dev/console ---- it was developed  for use in a LiveCD

               environment that boots WITHOUT a graphical login screen, so it

               just provides output  to the text console.


               If you have a graphical environment booted on LiveCD, you might want

               to change the output of the script and             

                 redirect it somewhere else, or make other modifications


               OR: you could modify your environment to be non-graphical.

               (In intro section of the kickstart config file, change

                any xconfig options to the single line skipx



          3. Add repo to the kickstart config file


In the intro section, add the following line to point to the new software (it is already in repo format) – Note that has 3 consecutive slashes in the URL (two for the URL syntax, last one is part of the pathname).


repo --name=megasr  --baseurl=file:///root/SWRAID

 

 

           4.      Add packages to the kickstart config file:

In the %packages section, add the following two package names at the end of the list:


kmod-megasr

storcli



            5.      Modify post-create script in the regular %post section (this runs in a chroot

                    environment in the  LiveOSimage being built).


At the end of the section, add these lines (just cut and paste from here – only possible

variable is that directory   /root/SWRAID if you put that stuff elsewhere.


echo "blacklist ahci" >>/etc/modprobe.d/blacklist.conf

cat >/etc/rc.local << EOF_rclocal

#!/bin/bash

service atd start

sleep 3

if dmidecode | grep -A 3 'System Information'| grep UCSC-C >/dev/null

then

        at now + 1 min << EOF_ATT

        /root/SWRAID/makeswraidmirror

EOF_ATT

fi

EOF_rclocal

 

 

 

          6.        Modify the non-chroot post-create section %post –nochroot (or create such a section

                    if you don’t have one yet)


Add the following lines at the end (just cut and paste from this document. The only variable

is going to be that directory /root/SWRAID, if you used something different:


cp -r /root/SWRAID $INSTALL_ROOT/root

rm -rf /var/tmp/initrd

mkdir /var/tmp/initrd

cp $LIVE_ROOT/isolinux/initrd0.img /var/tmp/initrd/initrd.gz

cd /var/tmp/initrd

zcat initrd.gz | cpio -ivmud

echo "blacklist ahci" >>etc/modprobe.d/blacklist.conf

rm -f initrd.gz

find . |cpio -ocv |gzip -9 >initrd0.img

cp -f initrd0.img $LIVE_ROOT/isolinux/

 

          7.      You are ready to use livecd-creator with your modified kickstart config file to create your new LiveCD image.

Attachments

    Outcomes