LDP/LDP/howto/docbook/Linux-Promise-RAID1-HOWTO.xml

482 lines
14 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://docbook.org/xml/4.1.2/docbookx.dtd" []>
<article id="Linux-Promise-RAID1-HOWTO">
<articleinfo>
<title>Linux Migration to Promise RAID Card HOWTO</title>
<author>
<firstname>Benjamin</firstname>
<surname>Simkin</surname>
<affiliation>
<address><email>bensimkin (at) union.org.za</email></address>
</affiliation>
</author>
<!-- All dates specified in ISO "YYYY-MM-DD" format -->
<pubdate>2002-12-16</pubdate>
<!-- Most recent revision goes at the top; list in descending order -->
<revhistory id="revhistory">
<revision>
<revnumber>1.5</revnumber>
<date>2003-03-25</date>
<authorinitials>bs</authorinitials>
<revremark></revremark>
</revision>
<revision>
<revnumber>1.4</revnumber>
<date>2002-12-16</date>
<authorinitials>bs</authorinitials>
<revremark>Changed URL for Promise website</revremark>
</revision>
<revision>
<revnumber>1.3</revnumber>
<date>2002-09-04</date>
<authorinitials>bs</authorinitials>
<revremark>Added Troubleshooting section</revremark>
</revision>
<revision>
<revnumber>1.1</revnumber>
<date>2002-08-05</date>
<authorinitials>bs</authorinitials>
<revremark></revremark>
</revision>
</revhistory>
<abstract>
<para>
This document aims to outline the steps of how to migrate an existing
(Red Hat) Linux install onto a Promise TX2 Card for the purposes of
RAID-1 Mirroring. Although I am concentrating on Red Hat, the same
principles may be applied to any other distribution.
</para>
</abstract>
</articleinfo>
<sect1 id="intro">
<title>Introduction</title>
<para>
This document contains two main sections, the module setup, and the
migration. Neither of these are documented anywhere on the net.
</para>
<sect2>
<title>What?</title>
<para>
The Promise Fasttrak is a PCI Ultra 100 RAID Card. It can be
used as a RAID card, or as standard IDE interfaces. This
documentation DOES NOT address the issues of the 'ataraid' module,
but addresses the issues of setting up the card with the propriety
module 'ft', as supplied by 'Promise Technologies'.
</para>
</sect2>
<sect2>
<title>Why?</title>
<para>
The documentation that comes with the module contains erroneous
instructions that if followed, cause the card to not work properly.
Also, upon looking over the internet for such documentation, I found
a lack.
</para>
</sect2>
<sect2>
<title>How?</title>
<para>
Using the Promise Technology module. The module that Promise
Technologies provide works well, but the documentation they provide is
somewhat lacking.
</para>
</sect2>
<!-- Legal Sections -->
<sect2 id="copyright">
<title>Copyright and License</title>
<!-- The LDP recommends, but doesn't require, the GFDL -->
<para>
This document, <emphasis>Linux Migration to Promise RAID
Card-HOWTO</emphasis>,
is copyrighted (c) 2002 by <emphasis>Benjamin Simkin</emphasis>.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation
License, Version 1.1 or any later version published
by the Free Software Foundation; with no Invariant Sections,
with no Front-Cover Texts, and with no Back-Cover Texts.
A copy of the license is available at
<ulink url="http://www.gnu.org/copyleft/fdl.html">
http://www.gnu.org/copyleft/fdl.html</ulink>.
</para>
</sect2>
<sect2 id="disclaimer">
<title>Disclaimer</title>
<para>
No liability for the contents of this document can be accepted.
Use the concepts, examples and information at your own risk.
There may be errors and inaccuracies, that could be damaging to
your system. Proceed with caution, and although this is highly
unlikely, the author does not take any responsibility.
</para>
<para>
All copyrights are held by their by their respective owners,
unless specifically noted otherwise. Use of a term in this
document should not be regarded as affecting the validity of any
trademark or service mark. Naming of particular products or
brands should not be seen as endorsements.
</para>
</sect2>
<sect2 id="contact">
<title>Contact the Author</title>
<para>
You may email me (<email>bensimkin (at) union.org.za</email>) with
improvements and suggestions etc. Please include
in the subject line: "Promise RAID HOWTO".
</para>
</sect2>
</sect1>
<sect1 id="modinstall">
<title>Module Installation</title>
<sect2>
<title>What?</title>
<para>
You will need an existing Red Hat Linux Install, and you will need to
obtain the correct driver from the
<ulink url="http://www.promise.com/support/download/download_eng.asp">Promise website</ulink>.
</para>
<para>
Choose your card type, and then choose <emphasis>FastTrak Family Red
Hat Linux Driver Uniprocessor</emphasis>.
</para>
</sect2>
<sect2><title>How?</title>
<para>
Put the RAID Card into the computer, but leave the hard drive(s) on the motherboard. Boot up into Linux. Login as root.
You should have the tar file from the Promise site, if not, see "What?" section above.
</para>
<sect3><title>Extracting the module</title>
<para></para>
<itemizedlist>
<listitem><para>
Put the tar file into <filename>/tmp</filename>.
</para></listitem>
<listitem><para>Issue this command:
<command>tar vxf ftrhup_120b9.tar</command>
</para></listitem>
<listitem><para>Now we have access to the <filename>modules.cgz</filename>
file. Issue the following: </para>
<screen>
# gzip -dc modules.cgz &gt; modules.cpio
# cpio -idumv &lt; modules.cpio
</screen>
<para>
A few directories will be created, so move to the correct
directory, depending on your kernel version. You can get your
kernel version, by issuing: <command>uname -r</command>
</para></listitem>
<listitem><para>
You will see the <filename>ft.o</filename> file. Copy this file to the
<filename>/lib/modules/kernel-version/kernel/drivers/scsi</filename>
directory.
</para></listitem>
</itemizedlist>
</sect3>
<sect3><title>Creating the Initial RAM Disk</title>
<para>
The Fasttrak module, ft, needs scsi_mod. To use the card as a RAID
Card, you will also need sd_mod.
</para>
<para>
To boot off the card, we will need to create a ramdisk, with the
required modules, so that linux can see the hard drive(s).
</para>
<screen># /sbin/mkinitrd --preload scsi_mod --preload sd_mod --with ft initrd-kernel-version.img kernel-version</screen>
<para>
If your kernel version is <emphasis role="strong">2.4.2-2</emphasis>,
you would issue the command:
</para>
<screen># /sbin/mkinitrd --preload scsi_mod --preload sd_mod --with ft initrd-2.4.2-2.img 2.4.2-2</screen>
<para>
Now move the newly created ramdisk image to <filename>/boot</filename>.
Its time to edit <filename>lilo.conf</filename>.
</para>
<para>
Before we edit <filename>lilo.conf</filename>, its best to make a
floppy boot disk with the ft module included.
</para>
</sect3>
<sect3><title>Creating the Boot Disk</title>
<para>
This is very important, as something may go terribly wrong. If LILO
stops working, then we just put the disk in and fix the problem. You
will need the mkbootdisk program.
</para>
<screen># /sbin/mkbootdisk --device /dev/df0 --mkinitrdargs '--preload scsi_mid --preload sd_mod --with ft' kernel-version</screen>
<para>
If your kernel version is <emphasis role="strong">2.4.2-2</emphasis>,
then issue the following
</para>
<screen># /sbin/mkbootdisk --device /dev/df0 --mkinitrdargs '--preload scsi_mid --preload sd_mod --with ft' 2.4.2-2</screen>
</sect3>
</sect2>
</sect1>
<sect1 id="LinuxConf"><title>Linux Configuration</title>
<para></para>
<sect2><title>What?</title>
<para>
Instead of editing our current working system, we merely create an entry for
our new system. So if something stuffs up, we just reboot and we're fine.
</para>
</sect2>
<sect2><title>How?</title>
<para>
Example <filename>lilo.conf</filename> file:
</para>
<screen>
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
message=/boot/message
linear
default=linux
image=/boot/vmlinuz-2.4.2-2
label=linux
read-only
root=/dev/hda5
</screen>
<para>
Just copy, and edit the kernel part, as follows:
</para>
<screen>
image=/boot/vmlinuz-2.4.2-2
label=LinuxFromRAID
initrd=/boot/initrd-2.4.2-2.img
read-only
root=/dev/sda5
</screen>
<para>
Note, how we setup the ramdisk, and we setup the root value. Don't
set it as default yet.
Now run lilo, in verbose mode.
</para>
<screen># lilo -v -v</screen>
<para>
If you don't see any errors, we're fine, so halt the system.
</para>
<para>
Put only <emphasis role="strong">ONE</emphasis> hard drive on the
Card, the hard drive with the existing Linux system.
</para><para>
Boot up, and go into the card bios. Delete the array of the current set.
</para>
</sect2>
</sect1>
<sect1 id="arrayConf">
<title>Array Configuration</title>
<para></para>
<sect2><title>Building the Array</title>
<para>
Add the second hard drive to the card, and turn on your computer.
Go into the card bios, and create a mirror array, selecting the appropriate source disk. Make sure you <emphasis>Create and Build</emphasis> the array.
After that is done, follow the instructions of the next section.
</para>
</sect2>
<sect2><title>Changing Configuration Files</title>
<para>
Choose "LinuxFromRaid" Option at LILO.
</para><para>
It should boot up without any errors. It will, however
complain about swap. Ignore that, as we will fix it in a moment.
</para><para>
You may receive an error about incorrect module version, or a kernel mismatch. Please see the
"troubleshooting" section about this.
</para><para>
After we have booted up on the new system, we must edit a few files:
</para>
<para>
<itemizedlist>
<listitem><para><filename>/etc/lilo.conf</filename></para></listitem>
<listitem><para><filename>/etc/fstab</filename></para></listitem>
</itemizedlist>
</para>
<sect3><title><filename>/etc/lilo.conf</filename></title>
<para>
The parts in italics have been edited. (See the original
<filename>lilo.conf</filename> file as stated earlier on in this
HOWTO)
</para>
<screen>
boot=/dev/<emphasis>sda</emphasis>
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
message=/boot/message
linear
default=<emphasis>LinuxFromRAID</emphasis>
image=/boot/vmlinuz-2.4.2-2
label=linux
read-only
root=/dev/hda5
image=/boot/vmlinuz-2.4.2-2
label=LinuxFromRAID
initrd=/boot/initrd-2.4.2-2.img
read-only
root=/dev/sda5
</screen>
<para>
Now, save the file, and run lilo to write the boot record.
</para>
</sect3>
<sect3><title><filename>/etc/fstab</filename></title>
<para>
For every entry that pointed to the old location, you must now change
it to the scsi device, but use the same partition. For example:
</para>
<screen>
/dev/hda2 swap swap defaults 0 0
</screen>
<para>
If you saw this in your fstab, you would need to
change <filename>/dev/hda2</filename> to
<filename>/dev/sda2</filename>
Now reboot your system. That's it.
After the reboot, its best to check the status of the RAID.
</para>
</sect3>
</sect2>
</sect1>
<sect1><title>Monitoring the Array</title>
<para>
You can get detailed information by looking at the
directory <filename>/proc/scsi/fasttrak/</filename>
</para><para></para><para>
In that directory, you will see the file which corresponds to your array.
<screen>
# cat /proc/scsi/fasttrak/0
Promise FastTrak Series Linux Driver Version 1.2.0.14
Adapter1 - FASTTRAK100 TX2
Array - Array[1] : 1X2 Mirror (OK)
Drive -
1 : IC Primary /Master 41174MB BASE(0xb400) BM(0xc400) IRQ(11) UDMA5
3 : IC Secondary/Master 41174MB BASE(0xbc00) BM(0xc408) IRQ(11) UDMA5
</screen>
That is all.
</para>
</sect1>
<sect1><title>Troubleshooting</title>
<para>
You may get a kernel mismatch error message. This means that you don't have the correct version module for use with your kernel.
If you cannot get the correct module version for use with your kernel, choose the closest one, and follow these steps;
</para><para>
This may not work in some instances, so remember to have your boot disk handy.
</para>
<para>
<screen>
# cd /boot
# cat initrd-2.4.2-2.img |gunzip > /tmp/myimage
# mkdir /mnt/tmp
# mount /tmp/myimage /mnt/tmp -t ext2 -o loop=/dev/loop3
# cd /mnt/tmp
# vi linuxrc
</screen>
</para><para>
Now modify 'insmod ft' to 'insmod -f ft'.
</para><para>
This will force the sytem to load the module.
Save the file, and exit from vi (or emacs :))
</para><para>
<screen>
# umount /mnt/tmp
# gzip /tmp/myimage
# cp myimage.gz /boot/initrd-2.4.2-2.img
</screen>
</para><para>
You will obviously have to use the correct filename for your initrd file.
I am using 2.4.2-2 as example.
</para><para>
Now, reboot, and all should be well.
</para>
</sect1>
</article>