|
From: Michael Chase-S. <mi...@ch...> - 2003-05-13 20:03:12
|
Since you posted to the systeminstaller list, I assume you used one of
the systeminstaller tool (tksis, mksiimage, buildimage) to build this
image on the server. If so, the proper way to do what you are attempting
is to re-run the mksidisk command with a new disk table that describes
the partitions the way you want them. See the mksidisk man page for
details. After rerunning mksidisk, recreate the autoinstallscript and
you should be fine.
Mike
On Mon, 2003-05-12 at 19:55, Charles Holbrook wrote:
> I have gone in and edited three seperate files in an attempt to move
> /usr/local to a seperate drive, /dev/hdd1 to be exact. The install
> seems to be partially sucessfull. Autoinstall partitions both disks and
> starts copying all of the filesystem over. However when it gets to the
> point of running
> chroot /a/ systemconfigurator --configsi --stdin <<EOF
> I get an illegal operation
>
> The three files I edited were www4.image01a.master
> /etc/hosts --> /var/lib/systemimager/scripts/hosts
> /etc/systemimager/mounted_filesystems
>
> The changes made to these three file systems were to allow /usr/local to
> be installed on a second drive (/dev/hdd1) All of the scripts worked
> fine but came up with the chroot error.
>
> I changed all of the files I modified back to my original files (yes I
> actually made copies of those files before modifying them) and I am
> still getting the same error. I have gone through the manual for
> systemimager and looked at the FAQ. I have checked to make sure the
> image has the same version of both systemconfigurator and systemimager
> installed and both are the same. None of the files within the image
> itself were modified.
>
> And now for the long part. Below are the original
> www4.image.01a.master, mounted_filesystems, and autoinstallscript.conf
>
> #### BEGIN AUTOINSTALLSCRIPT.CONF ###
> <!--
> This file contains partition information about the disks on your
> golden
> client. It is stored here in a generic format that is used by your
> SystemImager server to create an autoinstall script for cloning this
> system.
>
> You can change the information in this file to affect how your target
> machines are installed. See "man autoinstallscript.conf" for details.
> -->
>
> <config>
> <!--
> This disk's output was brought to you by the partition tool "sfdisk".
> And by the numbers 4 and 5 and the letter Q.
> -->
> <disk dev="/dev/hda" label_type="msdos" unit_of_measurement="MB">
> <part num="1" size="2023" p_type="primary" p_name="-"
> flags="boot" />
> <part num="2" size="2997" p_type="primary" p_name="-" flags="-"
> />
> <part num="3" size="2573" p_type="primary" p_name="-" flags="-"
> />
> <part num="4" size="*" p_type="extended" p_name="-" flags="lba"
> />
> <part num="5" size="1051" p_type="logical" p_name="-" flags="-"
> />
> <part num="6" size="*" p_type="logical" p_name="-" flags="-" />
> </disk>
>
> <fsinfo line="10" real_dev="/dev/hda1" mount_dev="LABEL=/" mp="/"
> fs="ext3" options="defaults" dump="1" pass="1" />
> <fsinfo line="20" real_dev="none" mp="/dev/pts" fs="devpts"
> options="gid=5,mode=620" dump="0" pass="0" />
> <fsinfo line="30" real_dev="none" mp="/proc" fs="proc"
> options="defaults" dump="0" pass="0" />
> <fsinfo line="40" real_dev="none" mp="/dev/shm" fs="tmpfs"
> options="defaults" dump="0" pass="0" />
> <fsinfo line="50" real_dev="/dev/hda2" mount_dev="LABEL=/tmp"
> mp="/tmp" fs="ext3" options="defaults" dump="1" pass="2" />
> <fsinfo line="60" real_dev="/dev/hda6" mount_dev="LABEL=/usr/local"
> mp="/usr/local" fs="ext3" options="defaults" dump="1" pass="2" />
> <fsinfo line="70" real_dev="/dev/hda3" mount_dev="LABEL=/var/lib"
> mp="/var/lib" fs="ext3" options="defaults" dump="1" pass="2" />
> <fsinfo line="80" real_dev="/dev/hda5" mp="swap" fs="swap"
> options="defaults" dump="0" pass="0" />
> </config>
>
> ### END AUTOINSTALLSCRIPT.CONF
>
> ### BEGIN MOUNTED_FILESYSTEMS
>
> /dev/hda2 on / type ext3 (rw)
> none on /proc type proc (rw)
> usbdevfs on /proc/bus/usb type usbdevfs (rw)
> /dev/hda1 on /boot type ext3 (rw)
> none on /dev/pts type devpts (rw,gid=5,mode=620)
> none on /dev/shm type tmpfs (rw)
> /dev/hda6 on /usr/local type ext3 (rw)
>
>
> ### END MOUNTED_FILESYSTEMS
>
> ### BEGIN WWW9.SH (www4.image.01a.master)
>
> #!/bin/sh
>
> #
> # "SystemImager"
> #
> # Copyright (C) 1999-2001 Brian Elliott Finley
> <bri...@ba...>
> # Copyright (C) 2002 Bald Guy Software
> <bri...@ba...>
> #
> # This master autoinstall script was created with SystemImager v3.0.1
>
> VERSION=3.0.1
>
> PATH=/sbin:/bin:/usr/bin:/usr/sbin:/tmp
> ARCH=`uname -m \
> | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e
> s/sa110/arm/`
>
> shellout() {
> exec cat /etc/issue ; exit 1
> }
>
> # Pull in variables left behind by the linuxrc script.
> # This information is passed from the linuxrc script on the autoinstall
> media
> # via /tmp/variables.txt. Apparently the shell we use in BOEL is not
> # intelligent enough to take a "set -a" parameter.
> #
> . /tmp/variables.txt || shellout
>
> [ -z $IMAGENAME ] && IMAGENAME=www4.image.01a
> [ -z $OVERRIDES ] && OVERRIDES="www4.image.01a"
>
> ### BEGIN Check to be sure this not run from a working machine ###
> # Test for mounted SCSI or IDE disks
> mount | grep [hs]d[a-z][1-9] > /dev/null 2>&1
> [ $? -eq 0 ] && echo Sorry. Must not run on a working machine... &&
> shellout
>
> # Test for mounted software RAID devices
> mount | grep md[0-9] > /dev/null 2>&1
> [ $? -eq 0 ] && echo Sorry. Must not run on a working machine... &&
> shellout
>
> # Test for mounted hardware RAID disks
> mount | grep c[0-9]+d[0-9]+p > /dev/null 2>&1
> [ $? -eq 0 ] && echo Sorry. Must not run on a working machine... &&
> shellout
> ### END Check to be sure this not run from a working machine ###
>
>
> ### BEGIN Stop RAID devices before partitioning begins ###
> # Q1) Why did they get started in the first place?
> # A1) So we can pull a local.cfg file off a root mounted software RAID
> system.
> # They may not be started on your system -- they would only be
> started if
> # you did the stuff in Q3 below.
> #
> # Q2) Why didn't my local.cfg on my root mounted software RAID work for
> me
> # with the standard kernel flavour?
> # A2) The standard kernel flavour uses modules for the software RAID
> drivers --
> # therefore, software RAID is not available at the point in the boot
> process
> # where BOEL needs to read the local.cfg file. They are only pulled
> over
> # when this script is run, which is, of course, only runnable if it
> was
> # pulled over the network using the settings that you would have
> wanted it
> # to get from the local.cfg file, which it couldn't. Right?
> #
> # Q3) Whatever. So how do I make it work with a local.cfg file on my
> root
> # mounted software RAID?
> # A3) Compile an autoinstall kernel with software RAID, and any other
> drivers
> # you might need built in (filesystem, SCSI drivers, etc.).
> #
> # Find running raid devices
> if [ -f /proc/mdstat ]; then
> RAID_DEVICES=` cat /proc/mdstat | grep ^md | sed 's/ .*$//g' `
>
> # raidstop will not run unless a raidtab file exists
> echo "" >> /etc/raidtab || shellout
>
> # turn dem pesky raid devices off!
> for RAID_DEVICE in ${RAID_DEVICES}
> do
> DEV="/dev/${RAID_DEVICE}"
> # we don't do a shellout here because, well I forgot why, but we
> don't.
> echo "raidstop ${DEV}" && raidstop ${DEV}
> done
> fi
> ### END Stop RAID devices before partitioning begins ###
>
>
> ### BEGIN partition /dev/hda ###
> echo "Partitioning /dev/hda..."
> echo "Old partition table for /dev/hda:"
> parted -s -- /dev/hda print
>
> # Create disk label. This ensures that all remnants of the old label,
> whatever
> # type it was, are removed and that we're starting with a clean label.
> echo "parted -s -- /dev/hda mklabel msdos || shellout"
> parted -s -- /dev/hda mklabel msdos || shellout
>
> # Get the size of the destination disk so that we can make the
> partitions fit properly.
> DISK_SIZE=`parted -s /dev/hda print | grep 'Disk geometry for' | sed
> 's/^.*-//g' | sed 's/\..*$//' `
> [ -z $DISK_SIZE ] && shellout
> END_OF_LAST_PRIMARY=0
>
> echo "Creating partition /dev/hda1."
> START_MB=$END_OF_LAST_PRIMARY
> END_MB=$(echo "scale=3; ($START_MB + 2023)" | bc)
> echo "parted -s -- /dev/hda mkpart primary ext2 $START_MB $END_MB ||
> shellout"
> parted -s -- /dev/hda mkpart primary ext2 $START_MB $END_MB || shellout
> END_OF_LAST_PRIMARY=$END_MB
> echo parted -s -- /dev/hda set 1 boot on || shellout
> parted -s -- /dev/hda set 1 boot on || shellout
>
> echo "Creating partition /dev/hda2."
> START_MB=$END_OF_LAST_PRIMARY
> END_MB=$(echo "scale=3; ($START_MB + 2997)" | bc)
> echo "parted -s -- /dev/hda mkpart primary ext2 $START_MB $END_MB ||
> shellout"
> parted -s -- /dev/hda mkpart primary ext2 $START_MB $END_MB || shellout
> END_OF_LAST_PRIMARY=$END_MB
>
> echo "Creating partition /dev/hda3."
> START_MB=$END_OF_LAST_PRIMARY
> END_MB=$(echo "scale=3; ($START_MB + 2573)" | bc)
> echo "parted -s -- /dev/hda mkpart primary ext2 $START_MB $END_MB ||
> shellout"
> parted -s -- /dev/hda mkpart primary ext2 $START_MB $END_MB || shellout
> END_OF_LAST_PRIMARY=$END_MB
>
> echo "Creating partition /dev/hda4."
> START_MB=$END_OF_LAST_PRIMARY
> END_MB=$(( $DISK_SIZE - 0 ))
> echo "parted -s -- /dev/hda mkpart extended $START_MB $END_MB ||
> shellout"
> parted -s -- /dev/hda mkpart extended $START_MB $END_MB || shellout
> END_OF_LAST_PRIMARY=$END_MB
> END_OF_LAST_LOGICAL=$START_MB
> echo parted -s -- /dev/hda set 4 lba on || shellout
> parted -s -- /dev/hda set 4 lba on || shellout
>
> echo "Creating partition /dev/hda5."
> START_MB=$END_OF_LAST_LOGICAL
> END_MB=$(echo "scale=3; ($START_MB + 1051)" | bc)
> echo "parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB ||
> shellout"
> parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB || shellout
> END_OF_LAST_LOGICAL=$END_MB
>
> echo "Creating partition /dev/hda6."
> START_MB=$END_OF_LAST_LOGICAL
> END_MB=$(( $DISK_SIZE - 0 ))
> echo "parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB ||
> shellout"
> parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB || shellout
> END_OF_LAST_LOGICAL=$END_MB
>
> echo "New partition table for /dev/hda:"
> echo "parted -s -- /dev/hda print"
> parted -s -- /dev/hda print
> ### END partition /dev/hda ###
>
>
> ### BEGIN swap and filesystem creation commands ###
> echo "Load additional filesystem drivers."
> modprobe reiserfs
> modprobe ext2
> modprobe ext3
> modprobe jfs
> modprobe xfs
>
> echo "mke2fs -j /dev/hda1 || shellout"
> mke2fs -j /dev/hda1 || shellout
> echo "tune2fs -L / /dev/hda1"
> tune2fs -L / /dev/hda1
> echo "mkdir -p /a/ || shellout"
> mkdir -p /a/ || shellout
> echo "mount /dev/hda1 /a/ -t ext3 -o defaults || shellout"
> mount /dev/hda1 /a/ -t ext3 -o defaults || shellout
>
> echo "mke2fs -j /dev/hda2 || shellout"
> mke2fs -j /dev/hda2 || shellout
> echo "tune2fs -L /tmp /dev/hda2"
> tune2fs -L /tmp /dev/hda2
> echo "mkdir -p /a/tmp || shellout"
> mkdir -p /a/tmp || shellout
> echo "mount /dev/hda2 /a/tmp -t ext3 -o defaults || shellout"
> mount /dev/hda2 /a/tmp -t ext3 -o defaults || shellout
>
> echo "mke2fs -j /dev/hda6 || shellout"
> mke2fs -j /dev/hda6 || shellout
> echo "tune2fs -L /usr/local /dev/hda6"
> tune2fs -L /usr/local /dev/hda6
> echo "mkdir -p /a/usr/local || shellout"
> mkdir -p /a/usr/local || shellout
> echo "mount /dev/hda6 /a/usr/local -t ext3 -o defaults || shellout"
> mount /dev/hda6 /a/usr/local -t ext3 -o defaults || shellout
>
> echo "mke2fs -j /dev/hda3 || shellout"
> mke2fs -j /dev/hda3 || shellout
> echo "tune2fs -L /var/lib /dev/hda3"
> tune2fs -L /var/lib /dev/hda3
> echo "mkdir -p /a/var/lib || shellout"
> mkdir -p /a/var/lib || shellout
> echo "mount /dev/hda3 /a/var/lib -t ext3 -o defaults || shellout"
> mount /dev/hda3 /a/var/lib -t ext3 -o defaults || shellout
>
> echo "mkswap -v1 /dev/hda5 || shellout"
> mkswap -v1 /dev/hda5 || shellout
> echo "swapon /dev/hda5 || shellout"
> swapon /dev/hda5 || shellout
>
> ### END swap and filesystem creation commands ###
>
>
> ### BEGIN mount proc in image for tools like System Configurator ###
> echo "mkdir -p /a/proc || shellout"
> mkdir -p /a/proc || shellout
> echo "mount proc /a/proc -t proc -o defaults || shellout"
> mount proc /a/proc -t proc -o defaults || shellout
> ### END mount proc in image for tools like System Configurator ###
>
>
> # Filler up!
> rsync -av --exclude=lost+found/ --numeric-ids $IMAGESERVER::$IMAGENAME/
> /a/ || shellout
>
> # Leave notice of which image is installed on the client
> echo $IMAGENAME > /a/etc/systemimager/IMAGE_LAST_SYNCED_TO || shellout
>
>
> ### BEGIN generate new fstab file from autoinstallscript.conf ###
> cat <<'EOF' > /a/etc/fstab
> LABEL=/ / ext3 defaults 1 1
> none /dev/pts devpts gid=5,mode=620 0 0
> none /proc proc defaults 0 0
> none /dev/shm tmpfs defaults 0 0
> LABEL=/tmp /tmp ext3 defaults 1 2
> LABEL=/usr/local /usr/local ext3 defaults 1 2
> LABEL=/var/lib /var/lib ext3 defaults 1 2
> /dev/hda5 swap swap defaults 0 0
> EOF
> ### END generate new fstab file from autoinstallscript.conf ###
>
>
> ### BEGIN overrides ###
> for OVERRIDE in $OVERRIDES
> do
> rsync -av --numeric-ids $IMAGESERVER::overrides/$OVERRIDE/ /a/ ||
> echo "Override directory $OVERRIDE doesn't seem to exist, but that may
> be OK."
> done
> ### END overrides ###
>
>
> ##################################################################
> #
> # Uncomment the line below to leave your hostname blank.
> # Certain distributions use this as an indication to take on the
> # hostname provided by a DHCP server. The default is to have
> # SystemConfigurator assign your clients the hostname that
> # corresponds to the IP address the use during the install.
> # (If you used to use static_dhcp, is your man.)
> #
> #HOSTNAME=""
>
>
> ### BEGIN systemconfigurator ###
> # Configure the client's hardware, network interface, and boot loader.
> echo "Iamhavingproblems"
> chroot /a/ systemconfigurator --verbose --debug --configsi --stdin <<EOL
> || shellout
>
> [NETWORK]
> HOSTNAME = $HOSTNAME
> DOMAINNAME = $DOMAINNAME
>
> [INTERFACE0]
> DEVICE = eth0
> TYPE = dhcp
> EOL
> ### END systemconfigurator ###
>
>
> ### BEGIN Unmount filesystems ###
> echo "umount /a/var/lib || shellout"
> umount /a/var/lib || shellout
>
> echo "umount /a/usr/local || shellout"
> umount /a/usr/local || shellout
>
> echo "umount /a/tmp || shellout"
> umount /a/tmp || shellout
>
> echo "umount /a/proc || shellout"
> umount /a/proc || shellout
>
> echo "umount /a/ || shellout"
> umount /a/ || shellout
>
> ### END Unmount filesystems ###
>
>
> # Tell the image server we're done.
> rsync $IMAGESERVER::scripts/imaging_complete > /dev/null 2>&1
>
> # Take network interface down
> ifconfig eth0 down || shellout
>
> # Cause the system to make noise and display an "I'm done." message
> ralph="sick"
> count="1"
> while [ $ralph="sick" ]
> do
> echo -n -e "\\a"
> [ $count -lt 60 ] && echo "I've been done for $count seconds.
> Reboot me already!"
> [ $(($count / 60 * 60)) = $count ] && echo "I've been done for
> $(($count / 60)) minutes now. Reboot me already!"
> sleep 1
> count=$(($count + 1))
> done
>
>
> ### END WWW9.SH (www4.image.01a.master)
>
>
>
>
> -------------------------------------------------------
> Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
> The only event dedicated to issues related to Linux enterprise solutions
> www.enterpriselinuxforum.com
>
> _______________________________________________
> Systeminstaller-users mailing list
> Sys...@li...
> https://lists.sourceforge.net/lists/listinfo/systeminstaller-users
--
Michael Chase-Salerno br...@us...
IBM Linux Systems Technology Poughkeepsie, NY
System Installation Suite www.sisuite.org
|