Managing RAID on Linux - Derek Vadala [38]
After the system restarts, examining /proc/mdstat will also show that the RAID subsystem was successfully initialized with support for linear mode, RAID-0, RAID-1, and RAID-4/5.
# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid5]
read_ahead not set
unused devices: See the section Examining Arrays Using /proc/mdstat, later in this chapter, for more information. Patching Older Kernels Working with 2.0.X and 2.2.X kernels can be extremely confusing because of the layout and documentation for the available patches. Most people have a lot of trouble sifting through all the old and erroneous information relating to these kernel versions and their RAID implementations. While RAID support is included with 2.0.X and 2.2.X series kernels, the most recent drivers are not distributed with the kernel source code, and patches should be applied when possible. There are also known problems with RAID-5 on 2.2 and 2.0 kernels, so if you want to use RAID-5, you should upgrade to at least a 2.4 kernel. Kernel 2.2 When working with 2.2 series kernels, I strongly recommend that you upgrade to the latest RAID code (0.90). The 0.90 code is available as a patch to the kernel and should be applied before any attempt to build new arrays. As a general principle, you should always be working with version 0.90 (or later) of the RAID code. You can examine the file .../linux/include/linux/md.h to determine which version of the RAID code is present on 2.0 and 2.2 series kernels. Version information is located near the beginning of the file: [...] #define MD_MAJOR_VERSION 0 #define MD_MINOR_VERSION 36 #define MD_PATCHLEVEL_VERSION 6 [...] This 2.2 kernel has version 0.36.6 of the RAID subsystem; therefore, a patch should be applied. If .../linux/include/linux/md.h is either empty or missing, your kernel is probably already patched to version 0.90. Instead, check the file .../linux/include/linux/raid/md.h for the version information. Note the extra subdirectory named raid in the path. As the size of RAID code grew, a subdirectory was created to better organize its components. Patches for the 2.2 kernel are available at http://people.redhat.com/mingo/raid-patches/. A patch for the most recent sublevel release of 2.2, as well as patches for a few prior 2.2 sublevel releases, should be available at this site. Grab the one for the specific sublevel release with which you are working. If a patch for that particular sublevel release is unavailable, I recommend upgrading to the most recent 2.2 release and using the matching RAID patch. For example, if you are working with kernel 2.2.20, download the patch http://people.redhat.com/mingo/raid-patches/raid-2.2.20-A0. Apply the raid-2.2.20-A0 patch to your 2.2.20 kernel, using the -p1 flag to indicate that you are in the root directory of the source tree: # cd /usr/src/linux-2.2.20 # patch -s -p1 < /usr/src/patches/raid-2.2.20-A0 Passing the -s flag to patch invokes quiet mode. If patch is successful, no output it returned. If an error was encountered, then patch will output a list of reject files that contain more detailed information about the errors. If you encounter errors, it's possible that a faulty, or untested, patch was released. Try throttling your kernel backward one revision (to 2.2.19, in this case), download a new patch, and reapply it. When the problem is eventually corrected, you can safely upgrade and repatch. You can, alternatively, examine the reject files and attempt to manually fix problems that patch encounters. If you choose not to use quiet mode, then patch will return a list of files that have been successfully patched, in addition to the names of any reject files generated. Remember that new patch files and kernels are released often, so the filenames used throughout this book may differ slightly from the ones you encounter when downloading