Tux on VM

Last updated on:
Sunday, July 06, 2008

Software

Information

Community

News

Fun

Credits




Valid HTML 4.01!
Linux for Big Iron
mkinitrd and cloning notes for SUSE SLES8 and Red Hat EL3 AS on zSeries

This information was contributed by Jim Sibley on November 10, 2003.

SUSE Linux Enterprise Server 8 (SLES8) and Red Hat Enterprise Linux 3 (RHEL3) both use an initial ramdisk (initrd) during the boot process to include the device driver modules. This allows them to have a single script for all platforms to include all the necessary drivers for each platform and adds more flexibility in adding device drivers without having to recompile the kernel. This has several implications for the zSeries (i.e., s/390 or zSeries) Linux system administrator:
  1. mkinitrd may be required if new device drivers are needed
  2. Changing device address(es) may require mkinitrd
  3. Cloning sytems using chroot may require extra mounts
  4. cio_ignore and other kernel parameters for Red Hat

As mkinitrd may change from release to release, I suggest that you refer to the man pages on your release for more details.

Also included are two sample bash scripts to explain what is meant by vary and tar2tar.

1. mkinitrd may be required if new device drivers are needed (i.e., FBA or ECKD)
Both SUSE and Red Hat inspect the /proc filesystem to determine if the system is running on zSeries hardware. That information is used to include the necessary drivers. Additional drivers can also be included (see the mkinitrd man pages for each vendor for the exact syntax).
return to top
2. Changing device addresses may require a mkinitrd 3. Cloning sytems using chroot may require extra mounts

There are some things to consider when cloning systems, especially if the clones have different device addresses, such as they do in LPARs, or you want to include different device modules in the clone. Typically, the clone is copied from base system volumes to new volumes, then one does a chroot to put the IPL text on the new volumes. Using chroot brings up two issues for mkinitrd:

  • On zSeries, both distributions key on the /proc filesystem to determine which drivers to load.
  • They may use commands in /usr. In some configurations, you may have /usr on a different file system than the root directory and you must be able to locate the commands.

    With the ever increasing size of /usr, it may be necessary for /usr to be on separate volumes.
    In fact, a full install of RHEL3 may require three (3) 3390-3 images, as the full install exceeds 3 GB, before any local products are added.

The solution is to mount /proc and /usr on the new root volume before doing a chroot.

Also, the vendor may be using device LABELs instead of device nodes in /etc/fstab and /etc/zipl.conf. Either you need to initialize your new volumes with a label or return to the device node naming convention if the copy does not copy over the label for the volume (see below).

Suppose you are making a copy of the base system (the driver system is at the same level as the base). The procedure might look like this:

return to top
4. cio_ignore and other kernel parameters for Red Hat
Although Red Hat has moved the dasd=parameter to /etc/modules.conf, the other kernel parameters remain in /etc/zipl.conf. In you use a cio_ignore= list to keep the /proc/subchannels list small, especially in LPAR mode, then you may have to update the device addresses in both /etc/zipl.conf and /etc/modules.conf making the corresponding changes to dasd= and cio_ignore=.
return to top
Sample vary bash script
vary on deviceAddr
vary off deviceAddr
vary ? deviceAddr
#!/bin/bash
# //jls Oct 2003
# Jim Sibley <jlsibley@us.ibm.com>
varyon()
{
if [ "$VARY_ONLINE" == "1" ]
then
if [ "$VARY_ACTIVE" == "1" ]
then
echo "already active"
else
echo "set device range=$devAddr on" > /proc/dasd/devices
fi
else
echo "free 0x$devAddr" > /proc/cio_ignore
echo "add device range=$devAddr" > /proc/dasd/devices
fi
grep $devAddr /proc/dasd/devices
}

varyoff()
{
sync
cd
umount /mnt/$devAddr
echo "set device range=$devAddr off" > /proc/dasd/devices
grep $devAddr /proc/dasd/devices
}

varydisplay()
{
if [ "$VARY_ONLINE" == "1" ]
then
if [ "$VARY_ACTIVE" == "1" ]
then
echo "... $devAddr is online, active"
else
echo "... $devAddr is unknown and offline"
fi
grep -i $devAddr /proc/dasd/devices
else
echo "... $devAddr is offline"
fi
}

Action=$1
devAddr=$2
if [ "$devAddr" == "" ]
then
echo "no device address entered"
Action=""
else
VARY_DEVICE=$(grep -i $devAddr /proc/dasd/devices)
VARY_ONLINE=$(echo $VARY_DEVICE | grep -c $devAddr)
VARY_ACTIVE=$(echo $VARY_DEVICE | grep -c active)
fi

case $Action in
on)
varyon
;;
off)
varyoff
;;
?)
varydisplay
;;
*)
echo "vary [? | on | off] devAddr"
;;
esac

return to cloning
return to top
Sample tar2tar bash script
. tar2tar /mnt/oldroot /mnt/newroot
#!/bin/bash
# //rhi Jan 2000
# Richard Higson <richard.higson@GT.OWL.DE>
# //jls Aug 2001
# Jim Sibley <jlsibley@us.ibm.com>
# tar2tar from-dir to-dir
#
[ ! -d $1 ] && echo -n $1 is NOT a directory
[ ! -d $2 ] && mkdir -p $2 && echo -n Directory $2 created ...
[ -d $1 ] && [ -d $2 ] \
&& (cd $1 && tar -clpSf - .) | (cd $2 && tar xpSf -)
echo "... done $1 to $2 ..."
return to cloning
return to top

(11/9/2003 jlsibley@us.ibm.com)



 
Site hosting courtesy of Velocity Software