NOTES ON MOVING A LINUX MACHINE TO A COMPAQ ARRAY CONTROLLER



Goal: I have a linux machine running Redhat 7.3 and I want to move it to a more reliable machine with the capability to do hardware mirroring.

1. I made sure the bios in the machine and the firmware on the array controller were both the newest available. I went to the Compaq website and downloaded the new versions and installed.
2. I booted to the Compaq smartstart cd and did "system erase" and then configured the machine. Made sure the array controller was the first boot device, and the OS I picked was Linux, if Linux not available internet says pick Unixware2
3. I used the array configuration utility and made a mirrored setup, since I was using a 850r and had space for only two drives. If I had more space I would have done a Raid 5
4. I booted to Redhat 9 cd, this version is very good about detecting network cards and other hardware. I used the "linux rescue" mode to boot. It should pop a box saying it was loading the Compaq array driver.
5. Once in rescue mode, I made sure my new array drive was found, it was in /dev/ida its name was c0d0.
6. I used fdisk to partition the new drive with a structure similar to old one. This will make the restore of the data much easier. In my case I had a / , /var, swap and /u. I made the / partition active ( bootable).
7. I next had to make file systems on the new partitions using the mke2fs ( ext2) Example: mke2fs -L thelabel /dev/thediskpartition
8. I next mounted the new file system so I could restore the backup.
mkdir /restore
mount /dev/ida/c0d0p1 /restore
cd /restore
mount /dev/ida/c0d0p2 /restore/var
( p3 is swap)
mount /dev/ida/c0d0p4 /restore/u
mkdir /proc
9. Now I had to get the backup onto the machine so I could restore it. I ftp the file into /restore/u temporarily since it was so big.
10. restore the file
cd /restore
tar xvf /restore/u/bigolebackup.tar
11. The filesystems on my old machine were ext3 as evidence by the ext3 entries in the old /etc/fstab. I used the tune2fs -j /dev/ida/c0d0pX to make it ext3
12. My old machine was using grub, I could not figure out how to made grub work with the Compaq array controller so I switch to lilo. There was a sample lilo.conf in /etc named lilo.conf.anaconda I copied it to lilo.conf as a starting point.
My lilo.conf:

prompt
timeout=50
default=linux
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message
linear

image=/boot/vmlinuz-2.4.18-3

label=linux

initrd=/boot/initrd-2.4.18-3.img

read-only

root=/dev/hda1

But as you can see the "boot=/dev/hda" is wrong because my path is /dev/ida/c0d0p1 and the "root=/dev/hda1" is wrong too.
So I changed it to:

prompt
timeout=50
default=linux
boot=/dev/ida/c0d0p1
map=/boot/map
install=/boot/boot.b
message=/boot/message
linear

image=/boot/vmlinuz-2.4.18-3

label=linux

initrd=/boot/initrd-2.4.18-3.img

read-only

root=/dev/ida/c0d0p1


13. After editing lilo.conf I ran lilo and it said it did something :)
14. Next step, is to try and boot. I exited and rebooted the machine. It did not work it said something like "error 6 mounting ext3" and panicked. This made me sad. After a whole lot of internet research I determined that the kernel must not have the cpqarray compiled in, so I have to make a new initrd. It seems that the initrd  is a file that the boot loader uses before the kernal is started. The kernel can use the initrd contents for a two-phased system boot. To make a new initrd I edited the contents of /etc/modules.conf and added cpqarray line
new line added to /etc/modules.conf
alias scsi_hostadapter cpqarray
I then used the mkinitrd command while in /boot to create a new initrd in the /boot directory
mkinitrd initrd-2.4.18.3.cpqarray 2.14.18.3
this made a file named initrd-2.4.18.3.cpqarray in /boot
I had to re edit my /etc/lilo.conf to make sure it uses the new initrd
contents of new lilo.conf

prompt
timeout=50
default=linux
boot=/dev/ida/c0d0p1
map=/boot/map
install=/boot/boot.b
message=/boot/message
linear

image=/boot/vmlinuz-2.4.18-3

label=linux

initrd=/boot/initrd-2.4.18-3.cpqarray.img

read-only

root=/dev/ida/c0d0p1

I then ran lilo, and it sad it did something.

15. try to boot again.
16. machine booted ok, it ran kudzu for some device changes because the old machine had a sound card, different video etc.
16 all ok

SUMMARY:
• Make sure the compaq array is supported in the linux version, I know 7.3 is.
• Array devices are in /dev/ida
• Use lilo
• Add the compaq array to /etc/modules.conf and make a new initrd and point the lilo.conf to the new initrd.
• On a compaq server if you dont get the F10 for the system partition utilities the mbr is probably messed up, dos fdisk /mbr will fix or lilo
• Make sure filesystems types from the old machine and the new machines are the same, or screw with new /etc/fstab

Helpful Links
http://www.cpqlinux.com