Configuring Software Raid and LVM on Power using RHEL4U2 (Red Hat Enterprise Linux Advanced Server version 4 Update 2)
Contents
Prerequisites
We are using Red Hat Enterprise Linux Advanced Server 4 (RHEL AS4) on OpenPower 720.
It is recommended to use hardware raid adapters on all server systems. Still there are cases, where hardware raid is not applicable: for example for a scenario using two VIO servers serving each one disk to the client LPARs and using software mirroring on the client side.
Background
Using software RAID on POWER is different from using it on Intel due to the different boot loader. Power uses the Yaboot1 boot loader which is loaded by Open Firmware2 after identifying the PReP boot partition on the disk. Only disks containing the PReP boot partition can be selected in SMS (user interface to the Open Firmware). Yaboot starts and scans all the primary disk partitions searching for its own configuration file (usually /etc/yaboot.conf) and the kernel image to load. Unfortunately Yaboot can not scan software mirrored md-devices or LVM logical volumes. It also contains a build in knowledge of only some file systems: ext2 , ext3, reiserfs and fat. We are going to use separate /boot partition which will be a second primary partition on both disks and contain boot kernel, initrd and etc directory with yaboot.conf inside.
Target layout

Partitioning layout
We are going to create following partitions on our first disk:
| Name |
Type |
Format |
Size |
Purpose |
| /dev/sda1 |
PrePBoot / 41 |
No |
6 MB < 10MB |
PrepBoot partition, loaded by firmware |
| /dev/sda2 |
Linux Raid /fd |
EXT3 |
100 MB |
Raid device for /boot, will be used for md0 |
| /dev/sda3 |
Linux Raid /fd |
No |
16 GB (all place you have left) |
Raid device for LVM, will be used for md1 |
We will create almost the same partitions on the second disk, the only difference is, that the second disk should not have a PrePBoot partition. We will change the type later.
| Name |
Type |
Format |
Size |
Purpose |
| /dev/sdb1 |
Linux / 83 |
No |
6 MB < 10MB |
PrepBoot partition, loaded by firmware |
| /dev/sdb2 |
Linux Raid /fd |
EXT3 |
100 MB |
Raid device for /boot, will be used for md0 |
| /dev/sdb3 |
Linux Raid /fd |
No |
16 GB (all place you have left) |
Raid device for LVM, will be used for md1 |
Raid layout
We will create a raid device /dev/md0 containing /dev/sda2 and /dev/sdb2
and a raid device /dev/md1 containing /dev/sda3 and /dev/sdb3
| Name |
Include |
Format |
Mount point |
| /dev/md0 |
/dev/sda2, /dev/sdb2 |
ext3 |
/boot |
| /dev/md1 |
/dev/sda3, /dev/sdb3 |
LVM |
LVM |
LVM layout
We will use our raid device /dev/md0 as a physical disk and include it in the volume group /dev/volgrp01. We will create following logical volumes in this volume group.
| Name |
Format |
Size |
Mount point |
| usrlv |
ext3 |
3 GB |
/usr |
| optlv |
ext3 |
1 GB |
/opt |
| varlv |
ext3 |
512 MB |
/var |
| tmplv |
ext3 |
512 MB |
/tmp |
| swaplv |
swap |
1 GB |
no |
Step by step: manual installation
Start installation
Start your installation from CD or network. Power on your system or activate your LPAR and press 1 to enter SMS menu. Press 5 to enter "Select Boot Options" section, 1 in the next screen select "Select Install or Boot device" and select the boot device you are going to use.

Leave anaconda installer
After anaconda installer starts you will get the greeting screen and stop at "Disk partioning setup" screen.

Unfortunately we can not use Autopartition (it would setup LVM without any mirroring). Also the "Disk Druid" was not usable for a proper raid configuration. We are going to leave anaconda installer for a while and partition our disks manualy.
To do that press CTRL+z and you will get a shell.
Command line partitioning
Create partitions on /dev/sda (first disk)
- Use fdisk /dev/sda command. Use "h" for help, "n" for new partition, "t" for type, "a" to set boot flag, and "w" to write your partitioning to the disk.
- Create following partitions:
Create partitions on /dev/sdb (second disk)
In order to create the same partioning layout on the second disk we can repeat the same steps above or use sfdisk instead fdisk.
- Run "sfdisk -d /dev/sda > /tmp/sda.out" command in order to dump the partition table in to a file.
- Run "sfdisk /dev/sdb < /tmp/sda.out" in order to creat identical partition table on the second disk.
- Set the partition type to Linux/83 for /dev/sdb1 in order to avoid yaboot confusion.
Create Raid devices
Use following command in order to create a raid-device /dev/md0 containing the partitions /dev/sda2 and /dev/sdb2 for /boot:
and for LVM:
Create volume group and logical volumes
In order to configure LVM enter the lvm shell by issuing '''lvm''' command.
*Create physical volume:
*Create volume group:
*Create logical volumes:
Get back to anaconda installer

Type "exit" on the shell prompt and you will get back to anaconda installer. Select to use Disk Druid for partitioning.
Select your logical volumes and press F3 for edit. In the next screen choose file system options and set the volumes to be formatted.
One screen back set the proper mount point for each volume:
Select /dev/md0 and set it to be formatted and mounted as /boot. After finishing continue your installation, and let the system reboot.
Post Installation tasks
If everything is gone well, your system should reboot and come up with software raid /dev/md0 and /dev/md1 and LVM on it. If your system does not boot, the most likely cause will be the size of the PrepBoot partition. Make sure it is not bigger then 10 MB. You may also need to set your boot device in SMS menu.
Your partitioning should look like this:
- And your logical volumes:
- And you mount points like this:
Mirror PrepBoot partition
We need to have the same working PrepBoot partition on the second disk in order to be able to boot if the first one is absent or broken.
- We are going to mirror the PrepBoot partition using dd:
- Now we set the boot flag:
Set the boot list
We also need to set the OpenFirmware boot list to contain both disks:
References
- Linux on Power wiki page: http://oss.gonicus.de/openpower

- Disk mirroring using software RAID on RHEL 3.0 AS for IBM pSeries: http://www-106.ibm.com/developerworks/eserver/library/es-SW_RAID_LINUX.html

Author: Tomas Baublys
Thanks to:
Brian J. King, René Bersier, Michael Perzl, Dustin Kirkland, Martin Welk