Last updated on: Sunday, July 06, 2008
Software
Information
Community
News
Fun
Credits
|
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:
- mkinitrd may be required if new device drivers are
needed
- Changing device address(es) may require mkinitrd
- Cloning sytems using chroot may require extra mounts
- 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.
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
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:
- Your base system has 2 volumes, one for /on /dev/dasdc1 and one for /usr on /dev/dasdd1
- You vary on 2 new volumes, /dev/dasde and /dev/dasdf, format them, and make a
file system on each
- Mount the base system volumes as /mnt/oldroot and /mnt/oldusr
- Mount the new volumes/mnt/newroot, /mnt/newusr
- Copy the old volumes to the new volumes (dd, cp -rp, or tar2tar)
- Dismount the /mnt/newusr
-
Mount /proc to /mnt/newroot/proc
mount -t proc proc /mnt/newroot/proc
-
Mount the /mnt/newusr volume to /mnt/newroot
mount -t type /dev/dasdf1 /mnt/newroot/usr
-
chroot /mnt/newroot
- Change TCP/IP parameters, hostname, device addresses, etc, as needed
-
If the vendor is using device labels in /etc/fstab and /etc/zipl.conf, the copy you use may not preserve the labels on
the volume and you might have to change them to device nodes:
- mkinitrd
- zipl
- exit
- Unmount the new system
- Vary the new system offline
- IPL the new system
return to top
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
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
. 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)
|