System information

76 Sharing and maintaining SLES 10 SP2 Linux under z/VM
#+--------------------------------------------------------------------------+
function mountSourceRoot()
# Mount disk at 11b1 over /mnt/source, then make mount points.
# Then mount disks at 11be over usr, 11bf over opt and 11b0 over boot
#+--------------------------------------------------------------------------+
{
echo ""
echo "Making source mount point ..."
if [ ! -d /mnt/source ]; then
mkdir /mnt/source
if [ "$?" != 0 ]; then exit 39; fi
fi
echo ""
echo "Mounting source root file system over /mnt/source ..."
dev11b1=/dev/$(egrep '^0.0.11b1' /proc/dasd/devices | awk '{ print $7 }')1
mount -o ro $dev11b1 /mnt/source
# if [ "$?" != 0 ]; then exit 40; fi
}
#+--------------------------------------------------------------------------+
function mountTargetDisks()
# Mount disk at 21b1 over /mnt/target, then make mount points.
# Then mount disks at 21be over usr, 21bf over opt and 21b0 over boot
#+--------------------------------------------------------------------------+
{
dev21b0=/dev/$(egrep '^0.0.21b0' /proc/dasd/devices | awk '{ print $7 }')
dev21b1=/dev/$(egrep '^0.0.21b1' /proc/dasd/devices | awk '{ print $7 }')
dev21b5=/dev/$(egrep '^0.0.21b5' /proc/dasd/devices | awk '{ print $7 }')
dev21b6=/dev/$(egrep '^0.0.21b6' /proc/dasd/devices | awk '{ print $7 }')
dev21b7=/dev/$(egrep '^0.0.21b7' /proc/dasd/devices | awk '{ print $7 }')
dev21b8=/dev/$(egrep '^0.0.21b8' /proc/dasd/devices | awk '{ print $7 }')
echo ""
echo "Mounting target file systems over /mnt/target ..."
mkdir /mnt/target
# if [ "$?" != 0 ]; then exit 41; fi
mount "$dev21b1"1 /mnt/target
if [ "$?" != 0 ]; then exit 42; fi
echo ""
echo "Making target mount points ..."
mkdir -p /mnt/target/{boot,usr,var,opt,local,sys,proc}
mount "$dev21b0"1 /mnt/target/boot
if [ "$?" != 0 ]; then exit 43; fi
mount "$dev21b5"1 /mnt/target/local
if [ "$?" != 0 ]; then exit 44; fi
mount "$dev21b6"1 /mnt/target/var
if [ "$?" != 0 ]; then exit 45; fi
mount "$dev21b7"1 /mnt/target/usr
if [ "$?" != 0 ]; then exit 46; fi
mount "$dev21b8"1 /mnt/target/opt
if [ "$?" != 0 ]; then exit 47; fi
echo ""
echo "Mounting memory file systems ..."
mount -t sysfs sysfs /mnt/target/sys
if [ "$?" != 0 ]; then exit 48; fi
mount -t proc proc /mnt/target/proc
if [ "$?" != 0 ]; then exit 49; fi
}
#+--------------------------------------------------------------------------+