Online Book Reader

Home Category

Managing RAID on Linux - Derek Vadala [129]

By Root 1401 0
to find the same information in your printed manuals.

SuSE

SuSE now supports (as of 8.0) direct installation to software RAID, but I've noticed that it's buggy when compared with Red Hat's software RAID installation software. For example, YaST2 complains that /boot partitions cannot be created on a software RAID device. But clearly, this is an acceptable choice that is practiced by many users and other distributors.

Mandrake

Mandrake's RAID installation process (part of DrakX) is so seamless that it warrants almost no discussion. It is the most straightforward, and the most flexible, of all the installation-time RAID utilities that I have encountered. I used Mandrake 8.2 in my experiments. You should have no problems when using Mandrake to install directly to a software RAID.

Converting to Software RAID

The process for converting an existing system to utilize software RAID is simple and requires just a few steps:

Build a new kernel with software RAID support. Refer to Chapter 3 for details on how to include RAID support in the kernel. Be certain to include support for RAID-1, as well as generic RAID support. Remember, only RAID-1 works for boot partitions. In this tutorial, I'll assume that you are using RAID-1 for all system partitions, that your existing system partitions are on /dev/sda, and that the new disk is /dev/sdb.

After you reboot the system using your new kernel, create partitions on your new disk for each of the partitions (including swap space) on your existing system disk. So if you have three partitions on your existing disk (/, /boot, and swap) create three matching partitions on the new disk. If you want to alter the size of any system partition, do so at this point by creating the new partitions using different specifications. Don't forget to mark each new partition Linux RAID Auto (that's type 0xFD).

After creating partitions on the new disk (/dev/sdb), create a new RAID-1 for each partition. Include a partition from /dev/sdb in each array. If you use mkraid, you will need to create each array so that it has a failed-disk entry. The failed-disk entry corresponds to the existing partition on /dev/sda. The raid-disk entry for each array will be the new partition on /dev/sdb. I prefer to use mdadm for this process.# mdadm -C -n2 -l1 /dev/md0 /dev/sdb1 missing

missing is used as a placeholder for a disk that's not yet part of the array. In this case, we created a new RAID-1 in degraded mode (because only one partition, /dev/sdb1, was used). Repeat this process for each new system partition.

Once you have created an array for each system partition, create a new filesystem on each array. Use mkswap to initialize the array that will act as the swap partition.

Bring the system into single-user mode and mount each new partition at an arbitrary mount point. I prefer to create some temporary mount points in the /mnt directory (for example, /mnt/new-boot).

Edit /etc/fstab so that it contains the new RAID partitions instead of the existing partitions on /dev/sda. I advise removing the use of filesystem labels in /etc/fstab (LABEL=/home, for example) and using device names (such as /dev/md0 and /dev/md1) instead. This will avoid any confusion. Don't forget to change the entry for swap as well.

Edit /etc/lilo.conf and change the root line for the RAID kernel's stanza to reflect the new md entry. Don't change the boot line at this time.

Copy all the files from the current system partitions to the new arrays that will replace them. I find it best to use the find and cpio commands to accomplish this. First, change to the root directory of a filesystem. Then use the following command to copy all files to the new partition:# cd /boot

# find . -xdev | cpio -pm /mnt/new-boot

The -xdev flag that I've passed to find instructs it to only return files that are on the current filesystem. This is very important because when we copy files from the root partition, we don't want files from /boot to be copied, for example. The -p flag for cpio turns on pass-through mode, allowing another program to provide the

Return Main Page Previous Page Next Page

®Online Book Reader