From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lars Bro Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: Bootable CD Date: Sat, 13 Jul 2002 04:09:32 +0200 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <47F723800769CA44B96BB700F46C562E05E954@dkexh3w2.gnnettest.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1026526151 8045 127.0.0.1 (13 Jul 2002 02:09:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 13 Jul 2002 02:09:11 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.33 #1 (Debian)) id 17TCLP-00025e-00 for ; Sat, 13 Jul 2002 04:09:11 +0200 Original-Received: (qmail 2353 invoked by uid 5); 13 Jul 2002 02:09:53 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 2322 invoked from network); 13 Jul 2002 02:09:53 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (134.167.3.119) by 0 with SMTP; 13 Jul 2002 02:09:53 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0GZ6009EG0ODZG@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 12 Jul 2002 22:09:53 -0400 (EDT) Original-Received: from proxy.nettest.dk (mail.nettest.dk [195.184.43.250]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with SMTP id <0GZ600AEH0NXYQ@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 12 Jul 2002 22:09:34 -0400 (EDT) Original-Received: by proxy.nettest.dk; (5.65v4.0/1.3/10May95) id AA03658; Sat, 13 Jul 2002 04:09:32 +0200 Original-To: tru64-unix-managers@ornl.gov X-MIMEOLE: Produced By Microsoft Exchange V6.0.5762.3 Thread-Topic: SUMMARY: Bootable CD Thread-Index: AcIqElOfbXmQLROQTZSyQhfGaxxa4Q== Content-Class: urn:content-classes:message X-Ms-Has-Attach: X-Ms-Tnef-Correlator: Xref: main.gmane.org gmane.os.tru64.managers:959 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:959 Hi, managers I put a question to the board about how to manage the "time of last = shutdown" on a homemade bootable CD. The answer came promptly from Tom Blinn, that this = was a difficult matter and probably not worth trying to deal with. But several people have asked me: How DO you actually make a bootable CD = with a fair amount of functionality and so on.=20 The whole thing was actually documented by HP during the horrendous days = of "new hardware delivery" as you probably all know. But I will explain as good = as I can: First of all, you need a Unix system. I installed a system on an empty = machine, trying to make it not all too big. As far as I remember, there were = several choices, such as "minimal" or "custom". I think that I chose "minimal", but that = may be a matter of taste. As long as it fits into a 700 Mb CD. Then, I copied the whole thing into our repository host, so that I had a = complete file system hierarchy below one directory = /export/tools/CD/install_cd-1.4=20 That directory will in the following be referred to as the "root" (/) = directory. In order to make the thing boot on any system, I simply copied /vmunix=20 to /unix.=20 As everything is read-only on the CD, I made an "mfs" file system for = /tmp. The following is in /etc/fstab: -s204800 /tmp mfs rw 1 0 This means that /tmp will be a memory file system of 100 Mb.=20 Then, in order to make file domains, I made /ets/fdmns a link to /tmp/fdmns. I did not do anything to /dev. That remained on the CD, as /dev is full = of things like kmem and stuff that are needed, but of course, the entries = in /dev are invalid on the system to boot. Instead, in order to make access = to the disks of the computer you boot, you have to do something like cd /tmp /dev/MAKEDEV rz7 makefdmn /tmp/rz7f some_domain ... When the system boots, init changes the runlevel to whatever is = specified by initdefault in /etc/inittab. If you assign the runlevel to S, the system comes up, runs /.profile and gives you a boot prompt. So in=20 /etc/inittab: is:S:initdefault The .profile of root then only needs to contain the following: mount -a PATH=3D$PATH:/usr/local/bin export PATH mkdir /tmp/fdmns /opt/install/inst The mount -a command makes the memory filesystem for /tmp The mkdir command makes the /etc/fdmns link valid And the last command only applies to those of you who are interested in that auto-install thing it all started with:-) I then had two scripts, one to make the CD image and one to write the CD. It is roughly about making an ISO9660 image, then=20 allign it on a kilobyte boundary and at last disklabel it, so it becomes bootable. The script that makes the CD also copies my program into /opt/install, but that only applies to those that are interested in = that. You are free to use your scissors. lbr@dogbert /export/tools/CD/install> cat make_image VERSION=3D1.4 IMAGE=3Dinstall_cd-$VERSION.iso if [ -f $IMAGE ] then echo $IMAGE: already exists >&2 exit 1 fi cp install-$VERSION/* install_cd-$VERSION/opt/install mkisofs -R -D -a -o $IMAGE install_cd-$VERSION disklabel -w -t cdfs -f $IMAGE echo "\0\c" | /usr/bin/dd bs=3D1024k conv=3Dsync >> $IMAGE lbr@dogbert /export/tools/CD/install>=20 lbr@dogbert /export/tools/CD/install> cat write_cd if [ `ls *.iso 2>/dev/null | wc -w` =3D 0 ] then echo "No image file *.iso found" >&2 exit 1 fi if [ `ls *.iso | wc -w` -gt 1 ] then echo "More than one image file *.iso found" >&2 exit 1 fi echo "Ready to record(y/[n])\c" read ANS if [ "$ANS" =3D "y" ] then cdrecord dev=3D5,0 speed=3D4 *.iso fi lbr@dogbert /export/tools/CD/install>=20 That is all about that.=20 I hope, I did not leave anything out, and that I have not done anything=20 obviously stupid. Comments are welcome. If you have problems, ask me and I will try to help as good as I can, but I am no expert. BTW. I made quite a nice disaster recovery CD that on backup would = record all the disk labels of the disks and then make a tape with these(and = some other information). Then, it would place vdumps of /, /usr and /var = consecutively on the tape. The trick was, that on recovery, the system would first boot = on the CD, then recover the labels of all disks, make new file domains for /, /usr = and /var and then boot the system into singleuser mode. Because first when the = system is booted and /var is operational, whatever licenses for ADVFS-UTILITIES = or LSM would be activated. At this time, /.profile would be exchanged with a fake /.profile that drove the next phase which was to create all the = file domains and file sets (with whatever multi-volume and stuff needed). Then, the = system would exchange /.profile with the original and rename all entries in = /etc/rc3.d that had to do with Oracle, Sybase, xlogin, TeMip and so on. Finally, it = would place a pointer to the 3.rd phase in /sbin/rc3.d and reboot to multiuser mode. = As the system comes up in multiuser mode, phase 3 simply asks NSR to recover = ALL file sets belonging to the system and then reboot for the last time. All = over and done without operator intervention, just boot from the disaster CD. This = has worked fine at our greatest customer, but has some flaws: You cannot put in a = new ES40 with PCI cards put in differently as the original, because the = kernel would not be able to recognize the external devices. The recovery machine must = be identical to the original. I ask myself: why do we need anything else = than genvmunix? If anybody are interested, you can have that as well. Enjoy your summer holidays, Lars Bro Lars Bro | System Programmer - Denmark email Lars.Bro@nettest.com | dir +45 72112405=20 NetTest DK | Kirkebjerg all=E9 90, Broendby, zip 2605 | DK web www.nettest.com | tel +45 72112200 | fax +45 72 11 22 10