IBM®
Skip to main content
    Country/region [select]      Terms of use
 
 
    
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerworks > My developerWorks >  Dashboard > Linux for Power Architecture > ... > Red Hat > Setting up Red Hat on mdadm multipath device
developerWorks
Log In   View a printable version of the current page.
Overview Connect Spaces Forums Wikis
Setting up Red Hat on mdadm multipath device
Added by baublys, last edited by pjuerss on Apr 27, 2007  (view change)
Labels: 
(None)

Root on mdadm-multipath device (RHEL4)

Find below a short description how to setup a RHEL4 LPAR to use mdadm multipath device for /boot and /root.
Unfortunately it is not straightforward because the installation kernel (initrd) of RHEL4 does not include the multipath module for mdadm as it's provided by SLES.

Please note...

This workaround is not necessary on RHEL5 because it is possible to use dm-multipath! I've tested it and it worked smooth and without any issues and yes a description will appear on this Wiki shortly

Here're the required steps to setup your /boot and /root using mdadm-multipath:

1) Install RHEL4 on a non-multipath device (e.g. a lv on VIOS1)
2) After the system hast started, map the mpath devices on both vios and rescan the scsi bus in order to "see" them on the linux lpar
3) Create the following partition table on one device (e.g. sdb) using fdisk
1 Type: PrepBoot Size: Between 16 and 32 MB
2 Type: Linux RAID (fd) Size: 100MB
3 Type: Linux RAID (fd) Size: Rest of the volume
4) Set the bootflag for partition 1 (using "a" on fdisk prompt)
5) Create the multipath devices with (pls. adjust it to suit your environment):

mdadm -C /dev/md0 -n 2 -l mp /dev/sdb2 /dev/sdc2 
mdadm -C /dev/md1 -n 2 -l mp /dev/sdb3 /dev/sdc3

6) Copy the PrepBoot partition from sda1 to sdb1 with

dd if=/dev/sda1 of=/dev/sdb1 bs=1k

7) Create a filesystem on /dev/md0 with:

mke2fs -j /dev/md0

8) Mount /dev/md0 to /mnt and copy everything from /boot to /mnt (in my example). Umount /mnt and /boot and mount /dev/md0 to /boot.
9) Change /etc/fstab to reflect this - e.g. /dev/md0 /boot etc..
10) Create /dev/md1 as pv using pvcreate /dev/md1.
11) Add the volume to the rootvg using vgextend <Nameofthevg> /dev/md1
12) Copy the lv's using {{pvmove -n <name-of-the-lv> <source-device> <target-device> }} (see document for exact usage).
13) Edit /etc/modprobe.conf and add the following line:

alias multipath multipath

14) Edit /etc/lvm/lvm.conf and comment out the default filter and add the following:

#filter = [ "a/.*/" ]

filter = [ "a|/dev/md|", "r|.*|" ]

15) Recreate the initrd using the following command:

mkinitrd /boot/initrd-2.6.9-42.EL-mp.img 2.6.9-42.EL

16) Edit /etc/yaboot.conf and change the line saying "initrd" to point at the initrd you've created:

initrd=/initrd-2.6.9-42.EL-mp.img

17) Remove the old disk from the vg using vgreduce.
18) Remove the disk from the system
19) remove the mapping on vios1
20) restart the system - Enter SMS Menu and configure the boot device order

If everything worked corectly your LPAR comes up with the correct setup - i.e. /boot on /dev/md0 and / on /dev/md1

Have fun!


 
    About IBM Privacy Contact