home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / doc / HOWTO / mini / Software-RAID < prev    next >
Text File  |  1997-10-08  |  30KB  |  695 lines

  1.  
  2. Software-RAID Mini-HOWTO
  3. Linas Vepstas  <linas@fc.net>
  4. v0.21  29 September 1997
  5.  
  6. Preamble: This document is copylefted by Linas Vepstas (linas@fc.net).
  7. Permission to use, copy, distribute this document for any purpose is 
  8. hereby granted, provided that the author's / editor's name and
  9. this notice appear in all copies and/or supporting documents; and 
  10. that an unmodified version of this document is made freely available.
  11. This document is distributed in the hope that it will be useful, but 
  12. WITHOUT ANY WARRANTY, either expressed or implied.  While every effort 
  13. has been taken to ensure the accuracy of the information documented 
  14. herein, the author / editor / maintainer assumes NO RESPONSIBILITY 
  15. for any errors, or for any damages, direct or consequential, as a 
  16. result of the use of the information documented herein.
  17.  
  18. RAID, although designed to improve system reliability by adding
  19. redundancy, can also lead to a false sense of security and confidence 
  20. when used improperly.  This false confidence can lead to even greater 
  21. disasters.  Know what you are doing, test, be knowledgeable and aware!
  22.  
  23.  
  24. Introduction
  25. ------------
  26.  
  27. Qi.0: What is RAID?
  28. Ai.0: RAID stands for "Redundant Array of Inexpensive Disks", and
  29.     is meant to be a way of creating a fast and reliable disk-drive
  30.     subsystem out of individual disks.  
  31.  
  32. Qi.1: What is this document?
  33. Ai.1: This document is a tutorial/HOWTO/FAQ for users of the Linux MD 
  34.     kernel extension, the associated tools, and their use.
  35.     The MD extension implements RAID-0 (striping), RAID-1 (mirroring),
  36.     RAID-4 and RAID-5 in software.   That is, with MD, no special
  37.     hardware or disk controllers are required to get many of the 
  38.     benefits of RAID.
  39.  
  40.     This document is *NOT* an introduction to RAID; you must find this
  41.     elsewhere.
  42.     
  43. Qi.2: What levels of RAID does the Linux kernel implement?
  44. Ai.2: Striping (RAID-0) and linear concatenation are a part
  45.     of the stock 2.x series of kernels.  This code is 
  46.     of production quality; it is well understood and well 
  47.     maintained.  It is being used in some very large USENET 
  48.     news servers.
  49.  
  50.     RAID-1, RAID-4 & RAID-5 are not present in the stock kernel;
  51.     a separate patch needs to be applied to get this functionality. 
  52.     The current snapshots should be considered beta quality; that 
  53.     is, there are no known bugs but there are some rough edges and 
  54.     untested system setups.
  55.  
  56.     RAID-1 hot reconstruction has been recently introduced 
  57.     (August 1997) and should be considered alpha quality. 
  58.     RAID-5 hot reconstruction will be alpha quality any day now ...
  59.  
  60.  
  61. Qi.3: Where do I get it?
  62. Ai.3: Software RAID-0 and linear mode are a stock part of 
  63.     all current Linux kernels.  Patches for Software RAID-1,4,5 
  64.     are available from
  65.     http://luthien.nuclecu.unam.mx/~miguel/raid
  66.     See also the quasi-mirror 
  67.     ftp://linux.kernel.org/pub/linux/daemons/raid/
  68.     for patches, tools and other goodies.
  69.  
  70.  
  71. Qi.4: Are there other Linux RAID references?
  72. Ai.4: Generic RAID overview:           http://www.dpt.com/uraiddoc.html
  73.     General Linux RAID options:      http://linas.org/linux/raid.html
  74.     Linux-RAID mailing list archive: http://www.linuxhq.com/lnxlists
  75.     Linux Software RAID Home Page:   http://luthien.nuclecu.unam.mx/~miguel/raid
  76.     Linux Software RAID tools:       ftp://linux.kernel.org/pub/linux/daemons/raid/
  77.     Linux RAID-Geschichten:          http://www.infodrom.north.de/~joey/Linux/raid/
  78.  
  79. Qi.5: Who do I blame for this document?
  80. Ai.5: Linas Vepstas slapped this thing together.  However, 
  81.     most of the information, and some of the words were supplied by
  82.  
  83.        * Bradley Ward Allen <ulmo@Q.Net>
  84.        * Luca Berra <bluca@comedia.it>
  85.        * bochal@apollo.karlov.mff.cuni.cz (Bohumil Chalupa)
  86.        * Anton Hristozov <anton@intransco.com>
  87.        * Miguel de Icaza <miguel@luthien.nuclecu.unam.mx> 
  88.        * Ingo Molnar <mingo@pc7537.hil.siemens.at>
  89.        * alvin@planet.fef.com (Alvin Oga)
  90.        * Gadi Oxman <gadio@netvision.net.il>
  91.        * joey@finlandia.infodrom.north.de (Martin Schulze)
  92.        * Geoff Thompson  <geofft@cs.waikato.ac.nz>
  93.        * Edward Welbon <welbon@bga.com>
  94.        * Rod Wilkens <rwilkens@border.net>
  95.        * Leonard N. Zubkoff <lnz@dandelion.com>
  96.  
  97.     Thanks all for being there!
  98.  
  99.  
  100. ======================================================================
  101. Setup & Installation Considerations
  102. -----------------------------------
  103.  
  104. Qs.0: I must soon install Linux on new system, one requirement is to have
  105.     RAID1. Now I'm wondering what is the easiest way to do it. 
  106.  
  107. As.0: I keep rediscovering that file-system planning is one of the more
  108.     difficult Unix configuration tasks.  To answer your question, I can
  109.     describe what we did.
  110.     
  111.     We planned the following setup:
  112.     two EIDE disks, 2.1.gig each.
  113.     
  114.     disk partition mount point.  size  device
  115.       1      1        /       300M    /dev/hda1
  116.       1      2      swap       64M    /dev/hda2
  117.       1      3      /home     800M    /dev/hda3
  118.       1      4      /var      900M    /dev/hda4
  119.     
  120.       2      1      /rootfs   300M    /dev/hdc1
  121.       2      2      swap       64M    /dev/hdc2
  122.       2      3      /home     800M    /dev/hdc3
  123.       2      4      /var      900M    /dev/hdc4
  124.     
  125.     -- each disk is on a separate controller (& ribbon cable).
  126.        The theory is that a controller failure and/or ribbon failure
  127.        won't disable both disks.  There is a performance boost
  128.        from issuing parallel operations.
  129.     
  130.     -- Install linux on / in /dev/hda1  this will allow booting
  131.        and subsequent installation of raid patches, etc.
  132.     
  133.     -- /dev/hdc1 will contain a "cold" copy of /dev/hda1. This
  134.        is NOT a raid copy, just a copy-copy.  Its there just
  135.        in case disk1 fails completely;  we can use a rescue disk,
  136.        mark /dev/hdc1 as bootable, and use that to keep going,
  137.        without having to reinstall the system.
  138.     
  139.        The theory here is that in case of severe failure, I can still 
  140.        boot the system without worrying about raid superblock-corruption
  141.        or other raid failure modes & gotchas that I don't understand.
  142.     
  143.     -- /dev/hda3 and /dev/hdc3 will be mirrors /dev/md0
  144.     -- /dev/hda4 and /dev/hdc4 will be mirrors /dev/md1
  145.     
  146.     -- We picked /var and /home to be mirrored, and in separate
  147.        partitions, under the following (convoluted ???) logic:
  148.     
  149.        / will contain non-changing data -- for all practical purposes,
  150.        it will be read-only without actually being read-only.
  151.     
  152.        /home will contain slowly changing data -- an almost-read-only
  153.        system.
  154.     
  155.        /var will contain rapidly changing data, including mail spools,
  156.        database contents and web server logs. 
  157.     
  158.        The theory is that *if* for some bizarre reason, the operating
  159.        system goes wild, corruption is limited to one partition.  Thus,
  160.        if for some unlikely, hypothetical reason, the database starts
  161.        scribbling everywhere, it might clobber mail and log files, but 
  162.        not /home.
  163.     
  164.        I am not entirely satisfied with my logic & reasoning, but it was
  165.        the best I could do on short notice.  I would like to have some
  166.        scheme that verifies that files in /usr and /home are not changed,
  167.        e.g. some MD5 signature scheme that is run regularly.  The idea is 
  168.        to detect hacker intrusion as well as corruption.  Similarly, the
  169.        database contents are quite valuable, and I don't have a 
  170.        fault-tolerant plan for that that will let me sleep well at night.
  171.     
  172.     So, to complete the answer to your question:
  173.     *) Install Linux on disk 1, partition 1. Do NOT mount any of 
  174.        the other partitions. 
  175.     *) Install raid per instructions. 
  176.     *) Configure md0 and md1.
  177.     *) Convince yourself that you know what to do in case of a 
  178.        disk failure!  Discover sysadmin mistakes now, and not during
  179.        an actual crisis.  Experiment!  (we turned off power during
  180.        disk activity -- this proved to be ugly but informative).
  181.     *) Do some ugly mount/copy/unmount/rename/reboot scheme to 
  182.        move /var over to the /dev/md1.  Done carefully, this is not 
  183.        dangerous.
  184.     *) Enjoy!
  185.     
  186.  
  187. Qs.1: Can I strip/mirror the root partition (/)?
  188.     Why can't I boot Linux directly from the md disks?
  189.  
  190. As.1: Both LILO and Loadlin need an non-stripped/mirrored partition
  191.     to read the kernel image from.  If you want to strip/mirror the root
  192.     partition (/), then create an unstriped/mirrored partition.  Typically,
  193.     this is /boot.  Then you either use the initial ramdisk support, or 
  194.     some old patches that were posted a while back, to allow your root 
  195.     device to be striped.
  196.  
  197.     Alternately, use mkinitrd to build the ramdisk image, see below.
  198.     Edward Welbon <welbon@bga.com> writes:
  199.     > ... all that
  200.     > is needed is a script to manage the boot setup.  To mount an md filesystem
  201.     > as root, the main thing is to build an initial file system image that has
  202.     > the needed modules and md tools to start md.  I have a simple script that
  203.     > does this.
  204.     > 
  205.     > For boot media, I have a small _cheap_ SCSI disk (170MB I got it used for
  206.     > $20). This disk runs on a AHA1452, but it could just as well be an
  207.     > inexpensive IDE disk on the native IDE.  The disk need not be very fast
  208.     > since it is mainly for boot. 
  209.     > 
  210.     > This disk has a small file system which contains the kernel and the file
  211.     > system image for initrd.  The initial file system image has just enough
  212.     > stuff to allow me to load the raid SCSI device driver module and start the
  213.     > raid partition that will become root. I then do an echo
  214.     > 0x900>/proc/sys/kernel/real-root-dev (0x900 is for /dev/md0)  and exit
  215.     > linuxrc.  The boot proceeds normally from there. 
  216.     > 
  217.     > I have built most support as a module except for the AHA1452 driver that
  218.     > brings in the initrd filesystem.  So I have a fairly small kernel.  The
  219.     > method is perfectly reliable, I have been doing this since before 2.1.26
  220.     > and have never had a problem that I could not easily recover from.  The
  221.     > file systems even survived several 2.1.4[45] hard crashes with no real 
  222.     > problems.
  223.     > 
  224.     > At one time I had partitioned the raid disks so that the initial cylinders
  225.     > of the first raid disk held the kernel and the initial cylinders of the
  226.     > second raid disk hold the initial file system image, instead I made the
  227.     > initial cylinders of the raid disks swap since they are the fastest
  228.     > cylinders (why waste them on boot?).
  229.     > 
  230.     > The nice thing about having an inexpensive device dedicated to boot is
  231.     > that it is easy to boot from and can also serve as a rescue disk if
  232.     > necessary.  If you are interested, you can take a look at the script that
  233.     > builds my initial ram disk image and then runs LILO.
  234.     > 
  235.     > http://www.realtime.net/~welbon/initrd.md.tar.gz
  236.     > 
  237.     > It is current enough to show the picture.  It isn't especially pretty and
  238.     > it could certainly build a much smaller filesystem image for the initial
  239.     > ram disk.  It would be easy to a make it more efficient.  But it uses LILO
  240.     > as is.  If you make any improvements, please forward a copy to me 8-) 
  241.  
  242. Qs.2: I have heard that I can run mirroring over striping. Is this true?
  243.  
  244. As.2: Yes, but not the reverse.  That is, you can put a stripe over 
  245.     several disks, and then build a mirror on top of this.  However,
  246.     striping cannot be put on top of mirroring.  
  247.  
  248.     A brief technical explanation is that the linear and stripe 
  249.     personalities use the ll_rw_blk routine for access. ll_rw_blk
  250.     maps disk devices & sectors, not blocks.
  251.  
  252. Qs.3: What is the difference between RAID-1 and RAID-5 for a two-disk
  253.     configuration (i.e. the difference between a RAID-1 array  built 
  254.     out of two disks, and a RAID-5 array built out of two disks)?
  255.  
  256. As.3: There is no difference in storage capacity.  Nor can disks be 
  257.     added to either array to increase capacity (see Qs.4 below for
  258.     details).
  259.  
  260.     RAID-1 offers a performance advantage for reads: the RAID-1
  261.     driver uses distributed-read technology to simultaneously read 
  262.     two sectors, one from each drive, thus doubling read performance.
  263.  
  264.     The RAID-5 driver, although it contains many optimizations, does not
  265.     currently (September 1997) realize that the parity disk is actually
  266.     a mirrored copy of the data disk.  Thus, it serializes data reads.
  267.  
  268. Qs.4: Can I add disks to a RAID-5 array?
  269.  
  270. As.4: Currently, (September 1997) no. A conversion utility to allow this 
  271.    does not yet exist.  The problem is that the actual structure and layout 
  272.    of a RAID-5 array depends on the number of disks in the array.
  273.  
  274.  
  275.  
  276. ======================================================================
  277.  
  278. Error Recovery
  279. --------------
  280.  
  281. Qe.1: I have a RAID-1 (mirroring) setup, and lost power while there was
  282.     disk activity.  Now what do I do?
  283.  
  284. Ae.1: The redundancy of RAID levels is designed to protect against a 
  285.     *disk* failure, not against a *power* failure.
  286.  
  287.     To recover from this situation, you should do the following ...
  288.     xxx yyy zzz
  289.  
  290.  
  291. Qe.2: My RAID-1 device, /dev/md0 consists of two hard drive partitions:
  292.     /dev/hda3 and /dev/hdc3.    Recently, the disk with /dev/hdc3
  293.     failed, and was replaced with a new disk.   My best friend, who 
  294.     doesn't understand RAID, said that the correct thing to do now
  295.     is to dd if=/dev/hda3 of=/dev/hdc3.   I tried this, but things
  296.     still don't work.
  297.  
  298.  
  299. Ae.2: You should keep your best friend away from you computer.  
  300.     Fortunately, no serious damage has been done.  You can recover 
  301.     from this by running:
  302.  
  303.     "mkraid raid1.conf -f --only-superblock"
  304.  
  305.     By using dd, two identical copies of the partition were created.
  306.     This is almost correct, except that the RAID-1 kernel extension
  307.     expects the RAID superblocks to be different.  Thus, when you try 
  308.     to reactive RAID, the software will notice the problem, and
  309.     deactivate one of the two partitions.  By re-creating the superblock,
  310.     you should have a fully usable system.
  311.  
  312.  
  313. Qe.3: My RAID-1 device, /dev/md0 consists of two hard drive partitions:
  314.     /dev/hda3 and /dev/hdc3.   My best friend, who doesn't understand
  315.     RAID, ran fsck on /dev/hda3 while I wasn't looking, and now the 
  316.     RAID won't work.  What should I do?
  317.  
  318.  
  319. Ae.3: You should re-examine your concept of "best friend".
  320.     In general, fsck should never be run on the individual partitions
  321.     that compose a RAID array.  Assuming that neither of the partitions
  322.     are/were heavily damaged, no data loss has occurred, and the RAID-1
  323.     device can be recovered as follows:
  324.  
  325.     a) make a backup of the file system on /dev/hda3
  326.     b) dd if=/dev/hda3 of=/dev/hdc3
  327.     c) mkraid raid1.conf -f --only-superblock
  328.  
  329.     This should leave you with a working disk mirror.
  330.  
  331. Qe.4: I am confused by the above questions, but am not yet bailing out.
  332.     Is it safe to run 'fsck /dev/md0' ?
  333.  
  334. Ae.4: Yes, it is safe to run fsck on the md devices. In fact, this is
  335.     the *only* safe place to run fsck.
  336.  
  337. Qe.5: If a disk is slowly failing, will it be obvious which one it is?
  338.     I am concerned that it won't be, and this confusion could lead to 
  339.     some dangerous decisions by a sysadmin.
  340.  
  341. Ae.5: Once a disk fails, an error code will be returned from the low level
  342.     driver to the RAID driver. The RAID driver will mark it as "bad" in
  343.     the RAID superblocks of the "good" disks (so we will later know which
  344.     mirrors are good and which aren't), and continue RAID operation on
  345.     the remaining operational mirrors.
  346.     
  347.     This, of course, assumes that the disk and the low level driver can
  348.     detect a read/write error, and will not silently corrupt data, for
  349.     example. This is true of current drives (error detection schemes are
  350.     being used internally), and is the basis of RAID operation.
  351.  
  352.  
  353. Qe.6: What about hot-repair?
  354.  
  355. Ae.6: There is a plan to add "hot reconstruction" at some point. With
  356.     this feature, we can add several "spare" disks to the RAID set (be
  357.     it level 1 or 4/5), and once a disk fails, we will reconstruct it
  358.     on one of the spare disks in run time, without ever needing to shut
  359.     down the array.
  360.  
  361.     Gadi Oxman <gadio@netvision.net.il> writes:
  362.     > Currently, once the first disk is removed, the RAID set will be
  363.     > running in degraded mode. To restore full operation mode, you  
  364.     > need to:
  365.     > 
  366.     >         --      stop the array (mdstop /dev/md0)
  367.     >         --      replace the failed drive
  368.     >         --      run ckraid raid.conf to reconstruct its contents
  369.     >         --      run the array again (mdadd, mdrun)
  370.     > 
  371.     > At this point, the array will be running with all the drives, and
  372.     > again protects against a failure of a single drive.
  373.  
  374.     As of 22 July 97, there is an alpha version of MD that allows
  375.     (*) hot reconstruction/resyncing for RAID-1
  376.     (*) a spare disk to be hot-added to an already running RAID-1 array
  377.  
  378. Qe.7: I would like to have an audible alarm for "you schmuck, one disk 
  379.     in the mirror is down", so that the novice sysadmin knows that 
  380.     there is a problem.
  381.  
  382. Ae.7: The kernel is logging the event with a "KERN_ALERT" priority -- 
  383.     Find the xxx software package for the error log  files ...
  384.  
  385.  
  386. Qe.8: How do I run RAID-5 in degraded mode (with one disk failed, and 
  387.      not yet replaced)?
  388.  
  389. Ae.8: Gadi Oxman <gadio@netvision.net.il> writes:
  390.      > Normally, to run a RAID-5 set of n drives you have to:
  391.      > 
  392.      >         mdadd /dev/md0 /dev/disk1 ... /dev/disk(n-1)
  393.      >         mdrun -p5 /dev/md0
  394.  
  395.      Even if one of the disks has failed, you still have to mdadd it
  396.      as you would in a normal setup.  Then,
  397.      > The array will be active in degraded mode with (n - 1) drives.
  398.      > If "mdrun" fails, the kernel has noticed an error (for example,
  399.      > several faulty drives, or an unclean shutdown).
  400.      > 
  401.      > Use "dmesg" to display the kernel error messages from "mdrun".
  402.  
  403.      If the raid-5 set is corrupted due to a power loss, rather than 
  404.      a disk crash, one can try to recover by creating a new RAID superblock:
  405.  
  406.      >         mkraid -f --only-superblock raid5.conf
  407.  
  408.      A RAID array doesn't provide protection against a power failure or 
  409.      a kernel crash, and can't guarantee correct recovery.  Rebuilding
  410.      the superblock will simply cause the system to ignore the condition
  411.      by marking all the drives as "OK", as if nothing happened.
  412.  
  413.  
  414. Qe.14: Why is there no question 13?
  415.  
  416. Ae.14: If you are concerned about RAID, High Availability, and UPS, then
  417.      its probably a good idea to be superstitious as well.
  418.  
  419. ======================================================================
  420.  
  421. Troubleshooting Install Problems
  422. --------------------------------
  423.  
  424. Qd.0: What is the current best known-stable or probably stable 
  425.     patch for RAID in the 2.0.x series kernels?
  426.  
  427. Ad.0: As of 18 Sept 1997, it is 
  428.     "2.0.30 + pre-9 2.0.31 + Werner Fink's swapping patch 
  429.     + the alpha RAID patch"
  430.  
  431. Qd.1: I get the message: mdrun -a /dev/md0: Invalid argument
  432.  
  433. Ad.1: Use mkraid to initialize the RAID set prior to the first use.
  434.    mkraid ensures that the RAID array is initially in a consistent state
  435.    by erasing the RAID partitions. In addition, mkraid will create the
  436.    RAID superblocks.
  437.  
  438. Qd.2: I get the message: mdrun -a /dev/md0: Invalid argument
  439.      The setup was:
  440.      -- raid1 build as a kernel module
  441.      -- normal install procedure followed ... mdcreate, mdadd, etc.
  442.      -- cat /proc/mdstat shows
  443.         > Personalities :
  444.         > read_ahead not set
  445.         > md0 : inactive sda1 sdb1 6313482 blocks
  446.         > md1 : inactive
  447.         > md2 : inactive
  448.         > md3 : inactive
  449.      -- mdrun -a creates the error message /dev/md0: Invalid argument
  450.  
  451. Ad.2: Geoff Thompson replies:
  452.     > Try 'lsmod' to see if the modules is loaded, and if not,
  453.     > load it with 'modprobe raid1'.
  454.  
  455.  
  456. Qd.3: Truxton Fulton wrote:
  457.      > On my linux 2.0.30 system, while doing a mkraid for a raid-1 device,
  458.      > during the clearing of the two individual partitions, I got
  459.      > "Cannot allocate free page" errors appearing on the console,
  460.      > and "Unable to handle kernel paging request at virtual address ..."
  461.      > errors in the system log.  At this time, the system became quite 
  462.      > unusable, but it appears to recover after a while.  The operation 
  463.      > appears to have completed with no other errors, and I am 
  464.      > successfully using my raid-1 device.  The errors are disconcerting 
  465.      > though.  Any ideas?
  466.  
  467. Ad.3: Gadi Oxman replies:
  468.      > This was fixed in current pre-2.0.31 kernels:
  469.      > ftp://ftp.kernel.org/pub/linux/kernel/testing/pre-patch-2.0.31-9.gz
  470.  
  471. Qd.3: I'm not able to mdrun a raid1, raid4 or raid5 device.
  472.       If I try to mdrun a mdadd'ed device I get the message
  473.       "invalid raid superblock magic".
  474.  
  475. Ad.3: Make sure that you've run the 'mkraid' part of the install
  476.      procedure.
  477.  
  478. Qd.4: I get the message "invalid raid superblock magic" while trying to 
  479.      run an array which consists of partitions which are bigger than 4GB.
  480.  
  481. Ad.4: This bug is now fixed. (sept 97)  Make sure you have the latest 
  482.     raid code.
  483.  
  484.  
  485. ======================================================================
  486.  
  487. Performance, Tools & General Bone-headed Questions
  488. -------------------------------------------------
  489.  
  490.  
  491. Qp.1: I have 2 Brand X super-duper  hard disks and a Brand Y controller.
  492.      and am considering using md.  Does it significantly increase the 
  493.      throughput?  Is the performance really noticeable?
  494.  
  495. Ap.1: Linux MD RAID-0 (striping) performance:
  496.      Must wait for all disks to read/write the stripe.
  497.  
  498.      Linux MD RAID-1 (mirroring) read performance: 
  499.      MD implements read balancing. In a low-IO situation, this won't
  500.      change performance. But, with two disks in a high-IO environment,
  501.      this could as much as double the read performance.  For N disks
  502.      in the mirror, this could improve performance N-fold.
  503.  
  504.      Linux MD RAID-1 (mirroring) write performance: 
  505.      Must wait for the write to occur to all of the disks in the mirror.
  506.  
  507.  
  508. Qp.2: Are linear MD's expandable? Can a new hard-drive/partition be added,
  509.     and the size of the existing file system expanded?
  510.  
  511. Ap.2: Miguel de Icaza <miguel@luthien.nuclecu.unam.mx> writes:
  512.     > I changed the ext2fs code to be aware of multiple-devices instead of
  513.     > the regular one device per file system assumption.  
  514.     > 
  515.     > So, when you want to extend a file system, you run a utility program
  516.     > that makes the appropriate changes on the new device (your extra
  517.     > partition) and then you just tell the system to extend the fs using
  518.     > the specified device.
  519.     > 
  520.     > You can extend a file system with new devices at system operation
  521.     > time, no need to bring the system down (and whenever I get some extra
  522.     > time, you will be able to remove devices from the ext2 volume set,
  523.     > again without even having to go to single-user mode or any hack like
  524.     > that).
  525.     > 
  526.     > You can get the patch for 2.1.x kernel from my web page:
  527.     > http://www.nuclecu.unam.mx/~miguel/ext2-volume
  528.  
  529.  
  530. Qp.3: Where can I put the md commands in the startup scripts, so 
  531.      that everything will start automatically at boot time?
  532.  
  533. Ap.3: Rod Wilkens <rwilkens@border.net> writes:
  534.      > What I did is put "mdadd -ar" in the "/etc/rc.d/rc.sysinit" right 
  535.      > after the kernel loads the modules, and before the "fsck" disk 
  536.      > check. This way, you can put the "/dev/md?" device in the 
  537.      > "/etc/fstab".  Then I put the "mdstop -a" right after the 
  538.      > "umount -a" unmounting the disks, in the "/etc/rc.d/init.d/halt" 
  539.      > file.
  540.  
  541.      For raid-5, you will want to look at the return code for mdadd,
  542.      and if it failed, do a "ckraid --fix /etc/raid5.conf" to repair any
  543.      damage.
  544.  
  545.  
  546. Qp.4: I have SCSI adapter brand XYZ (with or without several channels), 
  547.      and disk brand(s) PQR and LMN, will these work with md to create
  548.      a linear/stripped/mirrored personality? 
  549.  
  550. Ap.4: Yes!
  551.  
  552.  
  553. Qp.5: I was wondering if it's possible to setup striping with more 
  554.      than 2 devices in md0? This is for a news server, and I have 
  555.      9 drives...  Needless to say I need much more than two. Is 
  556.      this possible?
  557.  
  558. Ap.5: Yes.  (describe how to do this)
  559.  
  560. Qp.6: When is Software RAID superior to Hardware RAID?
  561.  
  562. Ap.6: Normally, Hardware RAID is considered superior to Software 
  563.     RAID, because hardware controllers often have a large cache,
  564.     and can do a better job of scheduling operations in parallel.
  565.     However, integrated Software RAID can (and does) gain certain 
  566.     advantages from being close to the operating system.
  567.  
  568.     For example, ... ummm. Opaque description of caching of 
  569.     reconstructed blocks in buffer cache elided ...
  570.  
  571.  
  572. Qp.7: If I upgrade my version of raidtools, will it have trouble 
  573.     manipulating older raid arrays?  In short, should I recreate my 
  574.     RAID arrays when upgrading the raid utilities?
  575.  
  576. Ap.7: No, not unless the major version number changes.
  577.     An MD version x.y.z consists of three sub-versions:
  578.  
  579.         x:      Major version.
  580.         y:      Minor version.
  581.         z:      Patchlevel version.
  582.  
  583.     Version x1.y1.z1 of the RAID driver supports a RAID array with
  584.     version x2.y2.z2 in case (x1 == x2) and (y1 >= y2).
  585.  
  586.     Different patchlevel (z) versions for the same (x.y) version are
  587.     designed to be mostly compatible.
  588.  
  589.     The minor version number is increased whenever the RAID array layout
  590.     is changed in a way which is incompatible with older versions of the
  591.     driver. New versions of the driver will maintain compatibility with
  592.     older RAID arrays.
  593.  
  594.     The major version number will be increased if it will no longer make
  595.     sense to support old RAID arrays in the new kernel code.
  596.  
  597.     For RAID-1, it's not likely that the disk layout nor the
  598.     superblock structure will change anytime soon.  Most all 
  599.     Any optimization and new features (reconstruction, multithreaded 
  600.     tools, hot-plug, etc.) doesn't affect the physical layout.
  601.  
  602.  
  603.  
  604.  
  605. ==========================================================================
  606. Questions waiting for answers:
  607.  
  608. What are the option you have used for formating the (raid) disks
  609.  
  610.         I used:
  611.                 mke2fs -b 4096 -R stride=4 ... blah
  612.  
  613.         or is it supposed to be 64K * 4 drives:
  614.  
  615.                 mke2fs -b 4096 -R stride=262000 ... blah
  616.  
  617.         are there any other options ?
  618.  
  619. For testing the raw disk thru put...
  620.  
  621.         is there a character device for raw read/raw writes instead of
  622.         /dev/sdaxx that we can use to measure performance on the raid drives ??
  623.         is there a GUI based tool to use to watch the disk thru-put ??
  624.  
  625.  
  626.  
  627. ==========================================================================
  628. Wish list of enhancements to MD and related s/w:
  629.  
  630. Bradley Ward Allen <ulmo@Q.Net> wrote:
  631. >Ideas include:
  632. >
  633. >* Bootup parameters to tell the kernel which devices are to be MD devices
  634. >  (no more "mdadd")
  635. >* Making MD transparent to "mount"/"umount" such that there is no
  636. >  "mdrun" and "mdstop"
  637. >* Integrating "ckraid" entirely into the kernel, and letting it run
  638. >  as needed
  639. >
  640. >(So far, all I've done is suggest getting rid of the tools and putting
  641. >them into the kernel; that's how I feel about it, this is a filesystem,
  642. >not a toy.)
  643. >
  644. >* Deal with arrays that can easily survive N disks going out
  645. >  simultaneously or at separate moments, where N is a whole number >0
  646. >  settable by the administrator
  647. >* Handle kernel freezes, power outages, and other abrupt shutdowns better
  648. >* Don't disable a whole disk if only parts of it have failed, e.g., if
  649. >  the sector errors are confined to less than 50% of access over the
  650. >  attempts of 20 dissimilar requests, then it continues just ignoring
  651. >  those sectors of that particular disk.
  652. >* Bad sectors:
  653. >  * A mechanism for saving which sectors are bad, someplace onto the
  654. >    disk.
  655. >  * If there is a generalized mechanism for marking degraded bad blocks
  656. >    that upper filesystem levels can recognize, use that.  Program it if not.
  657. >  * Perhaps alternatively a mechanism for telling the upper layer that the
  658. >    size of the disk got smaller, even arranging for the upper layer to
  659. >    move out stuff from the areas being eliminated.  This would help with
  660. >    degraded blocks as well.
  661. >  * Failing the above ideas, keeping a small (admin settable) amount of
  662. >    space aside for bad blocks (distributed evenly across disk?), and
  663. >    using them (nearby if possible) instead of the bad blocks when it does
  664. >    happen.  Of course, this is inefficient.  Furthermore, the kernel ought
  665. >    to log every time the RAID array starts each bad sector and what is
  666. >    being done about it with a "crit" level warning, just to get the
  667. >    administrator to realize that his disk has a piece of dust burrowing
  668. >    into it (or a head with platter sickness).
  669. >
  670. >* Software-switchable disks: "disable this disk" (would block until
  671. >  kernel has completed making sure there is no data on the disk being
  672. >  shut down that is needed (e.g., to complete an XOR/ECC/other error
  673. >  correction), then release the disk from use (so it could be removed,
  674. >  etc.)); "enable this disk" (would mkraid a new disk if appropriate
  675. >  and then start using it for ECC/whatever operations, enlarging the
  676. >  RAID5 array as it goes), "resize array" (would respecify the total
  677. >  number of disks and the number of redundant disks, and the result
  678. >  would often be to resize the size of the array; where no data loss
  679. >  would result, doing this as needed would be nice, but I have a hard
  680. >  time figuring out how it would do that; in any case, a mode where it
  681. >  would block (for possibly hours (kernel ought to log something every
  682. >  ten seconds if so)) would be necessary); "enable this disk while
  683. >  saving data" which would save the data on a disk as-is and move it
  684. >  to the RAID5 system as needed, so that a horrific save and restore
  685. >  would not have to happen every time someone brings up a RAID5 system
  686. >  (instead, it may be simpler to only save one partition instead of
  687. >  two, it might fit onto the first as a gzip'd file even); finally,
  688. >  "re-enable disk" would be an operator's hint to the OS to try out
  689. >  a previously failed disk (it would simply call disable then enable,
  690. >  I suppose).
  691.  
  692.  
  693. ============================= END OF FILE ============================
  694.  
  695.