Building bootable floppies for AIX

Steve Dyer dyer at spdcc.COM
Fri Nov 30 04:25:14 AEST 1990


In article <4562 at umbc3.UMBC.EDU> dipto at umbc3.umbc.edu (Dipto Chakravarty) writes:
>Any comments/suggestions for dealing with this system administrative
>task for the PS/2s? What would a SA do in case of a system crash if
>he/she were to recover files from tape media whose drivers are not 
>in the default PS/2 AIX kernel that comes with the normal IBM
>distribution, for use in the maintenance mode in the event of a crash?

Well, it isn't straightforward, but it can be done.  We did something
similar at Project Athena for performing custom network installations
using the MIT remote virtual disk protocol, which required building a
kernel which could reside on a boot floppy and which had the RVD driver
already installed.  I've never written this out to hand to someone
coming to this "cold", so there may be omissions here.  Still, it
may help you.

The two boot diskettes are simply a bootable AIX PS/2 filesystem
on two floppies, with a specialized kernel which can configure itself
to have its root on floppy or hard disk, depending on what flags
are passed to it by the boot program.  The floppy device driver
knows to ask the user to swap diskettes if a block number goes
beyond the first floppy (or if the second floppy is inserted,
to remount the first.)  It's gross, but it works.

Make a copy of the 2 boot floppies using dd.  The first boot floppy
should be "dd"ed in its entirety.  The second boot floppy has a
pseudo-boot header in the first 4096 bytes, and the remainder is the
rest of the boot filesystem.  Therefore, you have to skip the first 4096
bytes on the second floppy.  The pseudo-boot header looks like this
(this is "od -c" output):
# od -c boot.2.diskid | more
0000000  366 366 366   D   I   S   K   I   D       2 366 366 366 366 366
0000020  366 366 366 366 366 366 366 366 366 366 366 366 366 366 366 366
*
0010000
In other words, 4096 bytes of octal 366 with the exception of the 8 bytes
in positions 3 to 10 (counting from 0).

Concatenate these two files and copy it to a medium which is mountable
(here we use RVD; you will have to have reserved a minidisk at least
2.88 mb in size which can receive the filesystem image.)

Build a new boot kernel (see below).

Mount the boot filesystem, rm <mountpoint>/unix.gen, delete whatever other
binaries you feel are unnecessary for your specialized needs, and
umount the boot filesystem.

Run fsck -s on the filesystem to resort the free list.

Mount the boot filesystem and copy your new kernel over as
<mountpoint>/unix.gen.

Unmount the boot filesystem.

Now, you have to copy over the filesystem back on to two floppies.
The first 360 4096 blocks go onto the first floppy, and
the second floppy contains the pseudo-boot header followed
by the remaining 359 4096-byte blocks of the filesystem.

OK.  Now you have to make a copy of the maintenance diskette, which is
easier, because it only takes up one disk.  Make a copy and mount that
writable.  You should make sure that you have a special file present on
that diskette for your special device driver.  Also, you can feel free
to delete files on your copy of the maintenance diskette which you feel
you don't need, and add programs which you will need.

Now, let's talk about building that new kernel which you want to
appear on the boot diskette.

Add the following stanza to /etc/master:

askboot: type = parm
        symbol = ASKBOOT
        patchaddr = askboot
        default = 0

You should build a new kernel by building a new version of /etc/system;
let's call it /local/system.min.i386.  Don't make these changes to your
existing /etc/system!  You should add (or retain) your device driver
specification stanzas.  You can delete everything else except the hard
disk, floppy and sysparms stanzas.  This is what my sysparms stanza
looks like:

sysparms:
        users = 2
        root = fm0h
        pipe = fm0h
        arg =  fm0h
        swap = fm0h
        dump = fm0h
        swaplow = 306
        nswap = 54
        name = "generic"
        locsite = 31
        askboot = 1
* configure out all of the optional packages
        merge = 0
        ipc43 = 0
        nfsserver = 0
        atdisk = 0

Build a bootable kernel by making a copy of /usr/sys/newkernel; call
it /usr/sys/newkernel.boot.  Change the definition of DFILE from
/etc/system to /local/system.min.i386.  Run newkernel.boot.
The resulting kernel in /tmp/sysgen.386 should be copied onto
the boot filesystem under the name <mountpoint>/unix.gen.

-- 
Steve Dyer
dyer at ursa-major.spdcc.com aka {ima,harvard,rayssd,linus,m2c}!spdcc!dyer
dyer at arktouros.mit.edu, dyer at hstbme.mit.edu



More information about the Comp.unix.aix mailing list