home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 1: Linux / CD1.iso / doc / HOWTO / mini / DPT-Hardware-RAID < prev    next >
Encoding:
Text File  |  1998-10-14  |  12.3 KB  |  397 lines

  1.   Linux DPT Hardware RAID HOWTO
  2.   Ram Samudrala (me@ram.org)
  3.   v1.1, 15 December 1997
  4.  
  5.   How to set up hardware RAID under Linux.
  6.   ______________________________________________________________________
  7.  
  8.   Table of Contents
  9.  
  10.  
  11.   1. Introduction
  12.  
  13.   2. Supported controllers
  14.  
  15.   3. What hardware should be used?
  16.  
  17.   4. Installation
  18.  
  19.      4.1 Installing and configuring the hardware
  20.      4.2 Configuring the kernel
  21.  
  22.   5. Usage
  23.  
  24.      5.1 fdisk, mke2fs, mount, etc.
  25.      5.2 Hotswapping
  26.      5.3 Performance
  27.  
  28.   6. Features in the DPT RAID driver
  29.  
  30.   7. Troubleshooting
  31.  
  32.      7.1 Upon bootup, no SCSI hosts are detected
  33.      7.2 RAID configuration shows up as N different disks
  34.      7.3 If all fails...
  35.  
  36.   8. References
  37.  
  38.   9. Acknowledgements
  39.  
  40.  
  41.  
  42.   ______________________________________________________________________
  43.  
  44.   1.  Introduction
  45.  
  46.   This document describes how to set up SCSI hardware RAID, focusing
  47.   mainly on host-based adapters from DPT, though the principles applied
  48.   here are fairly general.
  49.  
  50.   Use the information below at your own risk.  I disclaim all
  51.   responsibility for anything you may do after reading this HOWTO. The
  52.   latest version of this HOWTO will always be available at
  53.   http://www.ram.org/computing/linux/dpt_raid.html.
  54.  
  55.   2.  Supported controllers
  56.  
  57.   Currently the only well-supported host-based hardware RAID controller
  58.   (i.e, a controller for which there exists a driver under Linux) is one
  59.   that is made by DPT <http://www.dpt.com>. However, there exist other
  60.   host-based and scsi-to-scsi controller which may work under Linux.
  61.   These include the ones made by Syred <http://www.syred.com>, ICP-
  62.   Vortex <http://www.icp-vortex.com>, and BusLogic <http://www.bus-
  63.   logic.com>.  In addition, there exist plenty of SCSI-to-SCSI
  64.   controllers. See the RAID solutions for Linux page
  65.   <http://linas.org/linux/raid.html> for more info.
  66.  
  67.   If, in the future, there is support for other drivers, I will do my
  68.   best to incorporate that information into this HOWTO.
  69.  
  70.   3.  What hardware should be used?
  71.  
  72.   Given all these options, if you're looking for a RAID solution, you
  73.   need to think carefully about what you want.  Depending on what you
  74.   want to do, and which RAID level you wish to use, some cards may be
  75.   better than others.  SCSI-to-SCSI adapters may not be as good as host-
  76.   based adapters, for example (see the DPT comparison between host-based
  77.   and SCSI-to-SCSI adapters <http://www.dpt.com/hstvscsi.html> for why
  78.   this is the case).  Michael Neuffer (neuffer@kralle.zdv.uni-mainz.de),
  79.   the author of the EATA-DMA driver, has a nice discussion about this on
  80.   his Linux High Performance SCSI and RAID page <http://www.uni-
  81.   mainz.de/~neuffer/scsi/>.
  82.  
  83.   For the purposes of this HOWTO, I am assuming you have only a Linux
  84.   system running. Also, note that I've only tried this out with the DPT
  85.   Smartcache VI PM2144UW controller, with the DPT-supplied enclosure
  86.   (SmartRAID tower), and I have no experience with other set ups. So
  87.   things may be different for your setup.
  88.  
  89.   4.  Installation
  90.  
  91.   4.1.  Installing and configuring the hardware
  92.  
  93.   Refer to the instruction manual to install the card and the drives.
  94.   For DPT, since a storage manager for Linux doesn't exist yet, you need
  95.   to create a MS-DOS-formatted disk with the system on it (usually
  96.   created using the command "format \s" at the MS-DOS prompt).  You will
  97.   also be using the DPT storage manager for MS-DOS, which you should
  98.   probably make a copy of for safety.
  99.  
  100.   Once the hardware is in place, boot using the DOS system disk. Replace
  101.   the DOS disk with the storage manager. And invoke the storage manager
  102.   using the command:
  103.  
  104.  
  105.  
  106.        a:\ dptmgr
  107.  
  108.  
  109.  
  110.  
  111.   Wait a minute or so, and you'll get a nice menu of options.  Configure
  112.   the set of disks as a hardware RAID (single logical array). Choose
  113.   "other" as the operating system.
  114.  
  115.   The MS-DOS storage manager is a lot easier to use with a mouse, and so
  116.   you might want to have a mouse driver on the initial system disk you
  117.   create.
  118.  
  119.   Technically, it should be possible to run the SCO storage manager
  120.   under Linux, but it may be more trouble than its worth.  It's probably
  121.   more easier to run the MS-DOS storage manager under Linux.
  122.  
  123.   4.2.  Configuring the kernel
  124.  
  125.   You will need to configure the kernel with SCSI support and the
  126.   appropriate low level driver.  See the Kernel HOWTO
  127.   <http://sunsite.unc.edu/mdw/HOWTO/Kernel-HOWTO.html> for information
  128.   on how to compile the kernel. Once you choose "yes" for SCSI support,
  129.   in the low level drivers section, select the driver of your choice
  130.   (EATA-DMA for most EATA-DMA compliant (DPT) cards, EATA-PIO for the
  131.   very old PM2001 and PM2012A from DPT).  Most drivers, including the
  132.   EATA-DMA driver, should be available in recent kernel versions.
  133.   Once you have the kernel compiled, reboot, and if you've set up
  134.   everything correctly, you should see the driver recognising the RAID
  135.   as a single SCSI disk. If you use RAID-5, you will see the size of
  136.   this disk to be 2/3 of the actual disk space available.  The messages
  137.   you see upon bootup should look something like this:
  138.  
  139.  
  140.  
  141.        EATA (Extended Attachment) driver version: 2.59b
  142.        developed in co-operation with DPT
  143.        (c) 1993-96 Michael Neuffer, mike@i-Connect.Net
  144.        Registered HBAs:
  145.        HBA no. Boardtype    Revis  EATA Bus  BaseIO IRQ DMA Ch ID Pr QS  S/G IS
  146.        scsi0 : PM2144UW     v07L.Y 2.0c PCI  0xef90  11 BMST 1  7  N  64 252 Y
  147.        scsi0 : EATA (Extended Attachment) HBA driver
  148.        scsi : 1 host.
  149.          Vendor: DPT       Model: RAID-5            Rev: 07LY
  150.          Type:   Direct-Access                      ANSI SCSI revision: 02
  151.        Detected scsi disk sda at scsi0, channel 0, id 8, lun 0
  152.        scsi0: queue depth for target 8 on channel 0 set to 64
  153.        scsi : detected 1 SCSI disk total.
  154.        SCSI device sda: hdwr sector= 512 bytes. Sectors= 35591040 [17378 MB] [17.4 GB]
  155.  
  156.  
  157.  
  158.  
  159.   (The above display is for a setup with a single DPT SCSI controller,
  160.   configured as RAID-5, with three disks of 9 GB each.)
  161.  
  162.   5.  Usage
  163.  
  164.   5.1.  fdisk, mke2fs, mount, etc.
  165.  
  166.   You can now start treating the RAID as a regular disk. The first thing
  167.   you'll need to do is partition the disk (using fdisk).  You'll then
  168.   need to set up an ext2 filesystem.  This can be done by running the
  169.   command:
  170.  
  171.  
  172.  
  173.        % mkfs -t ext2 /dev/sdxN
  174.  
  175.  
  176.  
  177.  
  178.   where /dev/sdxN is the name of the SCSI partition.  Once you do this,
  179.   you'll be able to mount the partitions and use them as you would any
  180.   other disk (including adding entries in /etc/fstab).
  181.  
  182.   5.2.  Hotswapping
  183.  
  184.   We first tried to test hotswapping by removing a drive and putting it
  185.   back in the DPT-supplied enclosure/tower (which you buy for an
  186.   additional cost).  Before we could carry this out to completion, one
  187.   of the disks failed (as I write this, the beeping is driving me
  188.   crazy). Even though one of the disks failed, all the data on the RAID
  189.   drive is accessible.
  190.  
  191.   Instead of replacing the drive, we just went through the motions and
  192.   put the same drive back in.  The drive rebuilt itself and everything
  193.   seems to be okay.  During the time the disk had filed, and during the
  194.   rebuilding process, all the data was accessible. Though it should be
  195.   noted that if another disk had failed, we'd have been in serious
  196.   trouble.
  197.  
  198.  
  199.   5.3.  Performance
  200.  
  201.   Here's the output of the Bonnie program, on a 2144 UW with 9x3=17 GB
  202.   RAID 5 setup. The RAID is on a dual processor Pentium Pro machine
  203.   running Linux 2.0.32. For comparison, the Bonnie results for the IDE
  204.   drive on that machine are also given.
  205.  
  206.  
  207.  
  208.                   -------Sequential Output-------- ---Sequential Input--  --Random--
  209.                   -Per Char- --Block--- -Rewrite-- -Per Char- --Block---  --Seeks---
  210.                MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU   /sec  %CPU
  211.        RAID   100  9210 96.8  1613  5.9   717  5.8  3797 36.1 90931 96.8 4648.2 159.2
  212.        IDE    100  3277 32.0  6325 23.5  2627 18.3  4818 44.8 59697 88.0  575.9  16.3
  213.  
  214.  
  215.  
  216.  
  217.   It's clear that the RAID is great for block reads and writes (even
  218.   though write performance is degraded by using RAID-5), but it is not
  219.   very good at sequential re-writes.
  220.  
  221.   6.  Features in the DPT RAID driver
  222.  
  223.   This section describes some of the commands available under Linux to
  224.   check on the RAID configuration.  Again, while references to the
  225.   eata_dma driver is made, this can be used to check up on any driver.
  226.  
  227.   To see the configuration for your driver, type:
  228.  
  229.  
  230.  
  231.        % cat /proc/scsi/eata_dma/N
  232.  
  233.  
  234.  
  235.  
  236.   where N is the host id for the controller.  You should see something
  237.   like this:
  238.  
  239.  
  240.  
  241.        EATA (Extended Attachment) driver version: 2.59b
  242.        queued commands:         353969
  243.        processed interrupts:    353969
  244.  
  245.        scsi0 : HBA PM2144UW
  246.        Firmware revision: v07L.Y
  247.        Hardware Configuration:
  248.        IRQ: 11, level triggered
  249.        DMA: BUSMASTER
  250.        CPU: MC68020 20MHz
  251.        Base IO : 0xef90
  252.        Host Bus: PCI
  253.        SCSI Bus: WIDE Speed: 10MB/sec.
  254.        SCSI channel expansion Module: not present
  255.        SmartRAID hardware: present.
  256.            Type: integrated
  257.            Max array groups:              7
  258.            Max drives per RAID 0 array:   7
  259.            Max drives per RAID 3/5 array: 7
  260.        Cache Module: present.
  261.  
  262.  
  263.  
  264.  
  265.            Type: 0
  266.            Bank0: 16MB without ECC
  267.            Bank1: 0MB without ECC
  268.            Bank2: 0MB without ECC
  269.            Bank3: 0MB without ECC
  270.        Timer Mod.: present
  271.        NVRAM     : present
  272.        SmartROM  : enabled
  273.        Alarm     : on
  274.        Host<->Disk command statistics:
  275.                 Reads:      Writes:
  276.            1k:           0            0
  277.            2k:           0            0
  278.            4k:           0            0
  279.            8k:           0            0
  280.           16k:           0            0
  281.           32k:           0            0
  282.           64k:           0            0
  283.          128k:           0            0
  284.          256k:           0            0
  285.          512k:           0            0
  286.         1024k:           0            0
  287.        >1024k:           0            0
  288.        Sum   :           0            0
  289.  
  290.  
  291.  
  292.  
  293.   To get advanced command statistics, type:
  294.  
  295.  
  296.  
  297.        % echo "eata_dma latency" > /proc/scsi/eata_dma/N
  298.  
  299.  
  300.  
  301.  
  302.   Then you can do a:
  303.  
  304.  
  305.  
  306.        % cat /proc/scsi/eata_dma/N
  307.  
  308.  
  309.  
  310.  
  311.   to get more detailed statistics.
  312.  
  313.   To turn off advanced command statistics, type:
  314.  
  315.  
  316.  
  317.        % echo "eata_dma nolatency" > /proc/scsi/eata_dma/N
  318.  
  319.  
  320.  
  321.  
  322.   7.  Troubleshooting
  323.  
  324.   7.1.  Upon bootup, no SCSI hosts are detected
  325.  
  326.   This could be due to several reasons, but it's probably because the
  327.   appropriate driver is not configured in the kernel. Check and make
  328.   sure the appropriate driver (EATA-DMA for most DPT cards) is
  329.   configured.
  330.  
  331.   7.2.  RAID configuration shows up as N different disks
  332.  
  333.   The RAID has not been configured properly.  If you're using a DPT
  334.   storage manager, you need to configure the RAID disks as a single
  335.   logical array.  Michael Neuffer (neuffer@kralle.zdv.uni-mainz.de)
  336.   writes "When you configure the controller with the SM start it with
  337.   the parameter /FW0 and/or select Solaris as OS. This will cause the
  338.   array to be setup to be managed internally by the controller."
  339.  
  340.   7.3.  If all fails...
  341.  
  342.   Read the SCSI-HOWTO again.  Check the cabling and the termination.
  343.   Try a different machine if you have access to one.  The most common
  344.   cause of problems with SCSI devices and drivers is because of faulty
  345.   or misconfigured hardware.  Finally, you can post to the various
  346.   newsgroups or e-mail me, and I'll do my best to get back to you.
  347.  
  348.   8.  References
  349.  
  350.   The following documents may prove useful to you as you set up RAID:
  351.  
  352.  
  353.   ╖  DPT RAID Primer and other RAID/SCSI-related documents
  354.      <http://www.dpt.com/techno.html>
  355.  
  356.   ╖  EATA-DMA homepage <http://www.uni-
  357.      mainz.de/~neuffer/scsi/dpt/index.html>
  358.  
  359.   ╖  Linux Disk HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Disk-HOWTO.html>
  360.  
  361.   ╖  Linux Kernel HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Kernel-
  362.      HOWTO.html>
  363.  
  364.   ╖  Linux SCSI HOWTO <http://sunsite.unc.edu/mdw/HOWTO/SCSI-HOWTO.html>
  365.  
  366.   ╖  RAID Solutions for Linux <http://linas.org/linux/raid.html>
  367.  
  368.   9.  Acknowledgements
  369.  
  370.   The following people have been helpful in getting this HOWTO done:
  371.  
  372.  
  373.   ╖  Boris Fain (fain@zen.stanford.edu)
  374.  
  375.   ╖  Jos Vos (jos@xos.nl)
  376.  
  377.   ╖  Michael Neuffer (neuffer@kralle.zdv.uni-mainz.de)
  378.  
  379.   ╖  Ralph Wallace (rwallace@rwallace.interaccess.com)
  380.  
  381.   ╖  Russell Brown (russell@lutton.lls.com)
  382.  
  383.   ╖  Syunsuke Ogata (Syunsuke_Ogata@appear.ne.jp)
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.