Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a server with this hardware

  • two Intel Xeon E5620 CPUs
  • Areca 1880i 8-port SAS RAID PCIe 512MB cache
  • Areca Battery Backup Module
  • 5 pcs Hitachi Deskstar 7K3000 HDS723030ALA640 64MB 3TB

and have created one RAID 6 volume that makes use of all the 5 hard drives.

Unfortunately there is no support for the Areca 1880i RAID card in the Linux kernel on the CentOS 6.0 installation image. There is though an updated kernel module available on the Areca web site (both as a precompiled binary for RHEL 6.0 and as source code).

How do I write a kickstart script to automate the installation of CentOS 6.0 on the server?

Update: Good news! CentOS 6.2 has support for Areca 1880i. When I upgraded to CentOS 6.2 by doing "yum -y update", the new kernel had native support for Areca 1880i. I haven't tested a CentOS 6.2 kickstart installation though, but I guess that should work too.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

In a %pre section of the kickstart script we need to run the pre-install.sh script that loads the updated binary kernel module (arcmsr) with /sbin/insmod. After that the kickstart installation has access to the hard drive that the Areca 1880i raid card presents to the computer and can thus partition and create file systems on it. In a %post section of the kickstart script we need to run the post-install.sh script that installs the updated binary kernel module into /mnt/sysimage/lib/modules/ and then runs /sbin/mkinitrd so that the server will be able to boot after the installation.

The precompiled kernel module found at the Areca web page is packaged as a ZIP archive

http://www.areca.us/support/s_linux/driver/rhel/6_0.zip

but the unzip command is not available during the %pre section of a Centos 6.0 kickstart installation. Therefore we unzip the archive in advance.

$ mkdir /tmp/a
$ cd /tmp/a
$ wget --quiet  http://www.areca.us/support/s_linux/driver/rhel/6_0.zip
$ unzip 6_0.zip 
Archive:  6_0.zip
   creating: 6_0/
  inflating: 6_0/install.zip         
  inflating: 6_0/README.txt          
$ mkdir /tmp/b
$ cd /tmp/b
$ unzip /tmp/a/6_0/install.zip 
Archive:  /tmp/a/6_0/install.zip
  inflating: driver.img              
$ ls -l driver.img            
-rw-r--r-- 1 erik users 1474560 2011-05-09 10:48 driver.img

Now put the file driver.img on some internal web server. In this example the file will be available as http://www.example.com/driver.img but you need to adjust this URL in your own kickstart script. Here is what you write in the %pre section

%pre  --log=/tmp/kspre.log
#!/bin/sh

cd /tmp
wget http://example.com/driver.img
mkdir /arcmsr
mount -o loop driver.img /arcmsr
cd /arcmsr
sh ./pre-install.sh
sleep 5
dd if=/dev/zero of=/dev/sda bs=512 count=64
parted -s /dev/sda mklabel gpt 
%end

The sleep 5 was necessary as otherwise the parted -s /dev/sda mklabel gpt would fail like this

# parted -s /dev/sda mklabel gpt
Error: Can't have the end before the start! (start sector=34 length=-3)
Error: Can't have overlapping partitions.
Error: Can't have overlapping partitions.

We need to create a GUID Partition Table (GPT) because the raid card presents the RAID 6 volume as a 9 Tb hard drive to the computer. 9 Tb is bigger than the maximum 2 Tb that can be handled by a normal partition table.

The idea to use GPT came from a mailing list post by Joshua Daniel Franklin.

In a %post section of the kickstart script we first copy some of the installation files into /mnt/sysimage as they need to be available when we later run commands after a chroot into /mnt/sysimage

%post --nochroot --log=/mnt/sysimage/root/ks-post1.log

cp -r /tmp /mnt/sysimage/root/tmp
mkdir /mnt/sysimage/tmp/arcmsr
cp -r /arcmsr/* /mnt/sysimage/tmp/arcmsr

%end
%post --log=/root/ks-post2.log

cd /tmp/arcmsr
sh ./post-install.sh

%end

Note, that we need to have two %post sections, the first one without chroot and the second one with chroot into /mnt/sysimage. First I tried to /usr/sbin/chroot /mnt/sysimage inside a non-chroot %post section but that didn't work.

The partitioning scheme for the server could look like this

bootloader --location=mbr
clearpart --linux --drives=sda
part /boot --fstype=ext4 --size=8192
part pv.01 --grow --size=1
volgroup vg0 --pesize=4096 pv.01
logvol swap --name=lv_swap --vgname=vg0 --size=65536
logvol / --fstype=ext4 --name=lv0 --vgname=vg0 --grow --size=1024

The mailing list post by Joshua Daniel Franklin says one should avoid having zerombr or clearpart --all in the kickstart file as otherwise the GPT we created in the %pre section would be overwritten.

After installation the server looks like this

[user@server ~]$ cat /proc/meminfo |grep SwapTotal
SwapTotal:      67108856 kB
[user@server ~]$ df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/mapper/vg0-lv0    8256978       828   7836720   1% /
tmpfs                    12012         0     12012   0% /dev/shm
/dev/sda1                 8064       194      7460   3% /boot
share|improve this answer
    
A question, it seems like the driver.img is actually a driver disk that can be automatically loaded by the installed with the "dd" boot param. Have you tried that? –  katriel Aug 9 '11 at 19:00
    
Interesting, I didn't know about that boot param. I haven't tried to use it. Instead I automated the manual steps described in the file 6_0/README.txt. There they write do not pass "linux dd" boot prompt. –  Erik Sjölund Aug 10 '11 at 22:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.