DDF Fake RAID

From Linux Raid Wiki
(Difference between revisions)
Jump to: navigation, search
(fixed OBS links)
(added disclaimer)
Line 24: Line 24:
  
 
For '''installation''', you will need to create a '''driver disk''' and a '''anaconda updates disk'''. The procedure below has been tested with CentOS 6.4. It should work on older RHEL/CentOS 6 releases as well.
 
For '''installation''', you will need to create a '''driver disk''' and a '''anaconda updates disk'''. The procedure below has been tested with CentOS 6.4. It should work on older RHEL/CentOS 6 releases as well.
 +
 +
<div style="color:red; width:90%; margin-left:auto; margin-right:auto">'''DISCLAIMER OF WARRANTY AND LIABILITY:''' YOU USE THIS AT YOUR OWN RISK. THERE IS NO GUARANTEE OF ANY KIND THAT FOLLOWING THIS PROCEDURE WILL WORK. THE AUTHOR(S) OF THIS RECIPE SHALL NOT BE HELD LIABLE FOR ANY DAMAGE, INCLUDING DATA LOSS OR HARDWARE DAMAGE, THAT MIGHT BE CAUSED BY APPLYING THIS PROCEDURE TO YOUR SYSTEM(S).'''</div>
  
 
=== Creating the driver disk image ===
 
=== Creating the driver disk image ===

Revision as of 22:15, 23 August 2013

Contents

Enabling Linux MD on DDF Fake RAID systems

The terms "Fake RAID" or "BIOS RAID" denote systems with no RAID controller, but with a simple BIOS that is able to do basic RAID operations on an array of disks. For the actual runtime RAID implementation, this RAID solution relies on a OS driver. On Windows this will usually be a driver from the RAID vendor. On Linux, the MD RAID stack can be used as a fully featured, well tested and stable RAID stack - if mdadm understands the meta data used by the vendor. Linux has another tool as well, dmraid, which uses the kernel device mapper to access the data on the RAID arrays, but doesn't qualify as a fully featured RAID solution to the same extent as MD/mdadm. The advantage of dmraid over mdadm is that it understands many more meta data formats. As of 2013, most distributions use dmraid to access fake RAID in any format except the Intel IMSM (also "ISW", "Matrix") format.

One meta data format commonly found on modern RAID systems (real as well as "fake" RAID) is the SNIA DDF format. Both mdadm and dmraid have supported it for some time. This page is about tweaking Linux distributions to use mdadm rather than dmraid for DDF.

General Requirements

In order to run a DDF disk array with MD, your distribution needs

  1. a recent version of mdadm. As of 2013/08, I recommend a pre-release of mdadm 3.3. DDF support in mdadm has seen a lot of fixes and improvements in 3.3;
  2. udev rules that support invoking mdadm (rather than dmraid) when disks with DDF meta data are detected;
  3. support for mdadm on DDF in initial RAM disk, i.e. in tools like mkinitrd or dracut;
  4. support for mdadm on DDF in the OS installer.

The last requirement is optional, but not having it means to have to modify the system after installation to use mdadm instead of dmraid, and that is an expert task.

Installation support for various distributions

This is work in progress. I will describe the installation procedure for some distributions, hoping that users of other distributions will follow up.

RHEL 6 / CentOS 6

There is a repository of the required update packages on the openSUSE Build Service. By updating the mdadm and dracut packages, requirements 1.-3. above will be met.

For installation, you will need to create a driver disk and a anaconda updates disk. The procedure below has been tested with CentOS 6.4. It should work on older RHEL/CentOS 6 releases as well.

DISCLAIMER OF WARRANTY AND LIABILITY: YOU USE THIS AT YOUR OWN RISK. THERE IS NO GUARANTEE OF ANY KIND THAT FOLLOWING THIS PROCEDURE WILL WORK. THE AUTHOR(S) OF THIS RECIPE SHALL NOT BE HELD LIABLE FOR ANY DAMAGE, INCLUDING DATA LOSS OR HARDWARE DAMAGE, THAT MIGHT BE CAUSED BY APPLYING THIS PROCEDURE TO YOUR SYSTEM(S).

Creating the driver disk image

The driver disk provides the updated packages (not actually "drivers") to be installed.

Download the latest RPMs for mdadm and dracut from the openSUSE Build Service to some directory on your system. The following procedure creates a driver disk for both 32bit and 64bit; it assumes that all RPMs have been downloaded to /tmp/rpms. It can be run on any Linux system, but be sure that createrepo on your system is compatible with RHEL 6 (to be sure, run the following commands on a RHEL/CentOS 6 system).

RPMS=/tmp/rpms
mkdir -p dud/rpms/{i386,x86_64}
cp $RPMS/*i686.rpm $RPMS/*.noarch.rpm dud/rpms/i386
cp $RPMS/*x86_64.rpm $RPMS/*.noarch.rpm dud/rpms/x86_64
(cd dud/rpms/i386; createrepo .) 
(cd dud/rpms/x86_64; createrepo .)
echo "Driver Update Disk version 3" >dud/rhdd3
mkisofs -J -r -V OEMDRV -o dud.iso dud

The resulting image can be burnt to a CD, copied to an USB stick, or placed e.g. on a HTTP server. See the Red Hat documentation for details.

Creating the anaconda updates image

The anaconda updates disk contains files to be modified during the installation itself.

File:Updates.tar.gz contains a skeleton directory with anaconda updates (python code and udev rules) which are necessary to change anaconda's logic such that mdadm rather than dmraid will be used to access the DDF disks. Unpack the contents of File:Updates.tar.gz and copy the mdadm and mdmon binaries for your architecture into the updates/ directory. Here is the procedure for x86_64:

tar xfvz Updates.tar.gz  # this will create the updates/ folder
# extract the mdadm and mdmon binaries for x86_64 from the RPM and copy them to updates/
mkdir tmp
(cd tmp; rpm2cpio $RPMS/mdadm*x86_64.rpm | cpio -idm)
cp -a tmp/sbin/{mdadm,mdmon} updates/

There are several methods to provde the contents of the updates directory during installation:

# This creates a updates.img file to put on a network server
(cd updates; find . | cpio -c -o) | gzip -c >updates.img
# This creates a updates ISO image to be used in a CD-ROM drive
mkisofs -J -r -V UPDATES -o updates.iso updates

The CD-ROM drive method will only work if your system has a second drive or if the installation itself is done from a network server (not from CD/DVD), because otherwise the installation media will be locked in DVD drive when you try to access the updates. You can also use a floppy or USB disk, see the Fedora Wiki for details.

Starting the installation

You need to activate the driver disk and the updates disk using the dd and updates boot options. Consult the Red Hat documentation for details. After the driver disk was read, you may see an "Error" dialog with the message "No new drivers were found on this driver disk. ...". This is not an error, because the disk actually doesn't contain drivers (only ordinary packages, which will be installed anyway). Choose "Continue" and tell the installer in the following screen that you don't have additional driver disks.

The installation should proceed normally. Your DDF disks should be offered as an MD device by anaconda.

Important: If the RAID array has just been created (e.g. in the BIOS SETUP), MD will start a rebuild during package installation. Let the rebuild finish before rebooting, otherwise MD will restart the rebuild process after reboot. This is because mdadm has currently no safe way to save the "progress" of a rebuild process in the meta data.

Checking if all worked correctly

After reboot, your system should come up cleanly with the DDF disks driven by MD. If no rebuild was running before rebooting after package installation, the array should be optimal and consistent after reboot, no further rebuild/recovery should be started. If you encounter problems, please complain oon the linux-raid mailing list.

Technical background

The code changes for both dracut and anaconda are fairly trivial. See File:Anaconda.patch.txt for the anaconda patch. The dracut patch can be found in the source RPM onthe openSUSE build service (see above).

Personal tools