MICROCARE SOFTWARE HELPDESK PO BOX 31, AMPTHILL RD, BEDFORD MK42 9QQ Telephone : Help Line 0234 226866 : Fax 0234 226090 _________________________________________________________________ This document gives details of the modus operandi used by the mkflop- pies shell script and the three other scripts ( mkkernel, mksystem and mkarchive ) that it invokes. 1. OBJECTIVE. The purpose of these scripts is to create a set of ( initially three ) floppies which will allow a user to re-create a RISCiX system after either a fatal hard disc problem, or after re-partitioning and re-formatting a hard disc to re-allocate storage space. The scripts will rebuild the system to the point where it is possible to go multi-user and to mount remote filesystems. At this point a remote machine may be mounted and files copied across, files may be transferred using tar, or a full restore may be carried out from backup media. 2. MEDIA It is possible that you may have received these scripts on a floppy disc. If that is the case the disc will be in adfs format, and will contain the scripts described below ( for use within RISCiX ) and Acorn's format program ( st506form2, for use within RISCOS ). The scripts may be copied to the RISCiX directory of your choice on the hard disc using the following commands : cd directory_name adfscp scripts . chmod ugo+x mk* 3. FORMATTING This process obviously pre-supposes that the user has access to the R140 format program ( st506form2 ). This is not included in the current release of RISCiX ( 1.01 ) but will be included on the upgrade disc for the next release ( 1.13 ). Alternatively the format program may be obtained from the Granada Microcare Helpdesk ( Telephone 0234 226866 ). Using the format program is relatively straightforward. If the drive is to be re-formatted using the standard shape then the defaults presented should be accepted. If the layout of the drive is to be changed ( for example, to create a larger RISCOS partition ) it should August 1, 1990 Page 2 be borne in mind that the minimum RISCiX partition size is 18 mega- bytes and that the swap partition size is best left at the default size. It is, therefore, perfectly feasible to configure an R140 with 20 megabytes of RISCOS space ( perhaps with 10 megabytes of this given over to the PC emulator ) and the rest of the drive allocated to RIS- CiX. In a networked environment any facilities not present on the local drive may be mounted remotely. 4. CREATING THE FLOPPIES. The three discs may be created by running the mkfloppies script. Alternatively, the discs may be made individually by running the appropriate scripts as detailed below. Note that to run all the scripts it is necessary to be logged in as root. 4.1. mkfloppies The script mkfloppies will create the three floppies required to rebuild a RISCiX system. It does this by calling the following three scripts. 4.2. mkkernel This script creates a floppy containing a RISCiX filesystem con- figured for optimal file space. A copy of the kernel ( /vmunix ) is then installed. In addition compressed copies of the release 1.13 shared c library ( if it exists ) and dsplit are also installed. These are for use later in the re-installation process. 4.3. mksystem This script also creates a floppy with a space optimised RISCiX filesystem. It then installs or creates the files and devices required to bring the R140 up from the floppy device. These are : /bin/sh /etc/init /etc/halt /dev/console /dev/fdf1024 /dev/rfdf1024 /dev/st0a /dev/st0S /dev/rst0a /dev/rst0S /dev/kmem /dev/null /dev/cmos /dev/tty In addition to these, various files and utilities required in order to create the new RISCiX filesystem are also installed . These are August 1, 1990 Page 3 /etc/mkfs /etc/newfs /etc/disktab /lib/c:8811031948.22 The following utilities are then copied to the floppy : /etc/mount /etc/umount /usr/ucb/uncompress /bin/mkdir /bin/cat /bin/chmod /bin/cp To save space the following utilities are now compressed and installed on the floppy : /bin/ls /bin/tar /etc/mknod Then abbreviated versions of the following files are created : /etc/mtab /etc/termcap ( Containing only the avc entry ) A script called mknewfs is now created ( by the mksystem script itself ) which will be used to actually create and set up the new RISCiX filesystem. This script is discussed in more detail under the USAGE section. The 'system' disc is now complete. 4.4. mkarchive The system and kernel discs contain enough utilities to create a new RISCiX filesystem and make it bootable in single-user mode. The purpose of the mkarchive disc is to create a disc containing enough utilities to enable the new system to go multi user and to mount the network. It also transports some other generally useful utilities. The total archive contains these files: /etc/getty /etc/fsck /etc/rc /etc/rc.net /etc/rc.config /etc/ttys /etc/ifconfig /bin/login August 1, 1990 Page 4 /bin/echo /bin/[ ( a symbolic link to test ) /bin/hostname /etc/restore /bin/kill /bin/ps /usr/ucb/vi This list may be extended or customised by editing the mkarchive shell script. 5. RISCOS files. In conjunction with preparing the three floppies as outlined above it is vital that backup copies are made of the !RISCiX applica- tion directory, the modules in $.App1.!System.Modules and the $.!Boot file in the RISCOS partition. These will need to be reinstalled before the process of rebuilding the RISCiX partition can begin. 6. USAGE Having used mkfloppies to create the three floppy set it may become necessary to to use it in many scenarios. We will consider two here. 6.1. RISCiX fails to boot from the hard disc. We will examine the possible situation where an R140 fails to boot after succesfully initiating the boot sequence from the RISCOS desktop. The first stage in the RISCiX boot sequence is the RISCiXFS module and this should be replaced first. If this fails to correct the problem the next possible cause may well be the kernel ( /vmunix ) itself. Armed with our previously prepared 'kernel' disc it is now possible to attempt to boot the kernel from the floppy device and the rest of RISCiX from the hard disc. To do this follow these steps : [1] At the RISCOS desktop press the F12 key. [2] At the RISCOS command line prompt ( * ), type : *co. device fd0 ( Note that the 0 character here is a zero ) [3] Insert the 'kernel' disc in the floppy drive. [4] Press Ctrl and Break together to reread CMOS ram. [5] Click the middle mouse button on the Task Manager icon - in the shape of an Archimedes 'A', on the desktop. This reveals the Task Menu. [6] Click the left mouse button on the 'Exit' option within the Task menu. [7] Now type the following command : August 1, 1990 Page 5 *boot vmunix st0(0,0) st0(0,1) Note the spaces in the command and the fact that the 0 is a zero. If all goes well this should eventually boot vmunix from the floppy and take the machine single user. If this succeeds it may well be that vmunix on the hard disc is corrupt. The floppy may now be mounted and vmunix replaced. If this process fails it may be that either init or one of the devices are corrupt. Armed with our 'kernel' and 'system' discs we can now boot RISCiX entirely from the floppy device. To do this ensure that steps 1 - 4 above have been carried out and then , with the kernel disc in the floppy drive , click on single user in the RISCiX mainte- nance menu ( see Acorn R140 Operations Guide, pages 41 to 45 ). After the kernel has successfully been loaded from the floppy disc it will wait one minute for the system disc to be inserted. Eventually the remainder of RISCiX will be loaded from the second floppy. At this stage it would be possible to mount the hard disc, examine the file system, and carry out repair work. 6.2. Rebuilding RISCiX. It may be that the hard disc has been re-formatted, either to correct a flaw or to re-allocate partition sizes. Armed with the three discs prepared as outlined above the procedure for rebuilding RISCiX is as follows: [1] Re-format and/or re-partition the hard disc. [2] Re-install the RISCOS !boot file and the !RISCiX application directory. [3] Ensure that the correct settings are established in CMOS ram. Note that details of the full R140 CMOS ram configurations, and how to set them, are available from Granada Microcare in a seperate document. [4] At the RISCOS desktop press the F12 key. [5] At the RISCOS command line prompt ( * ), type : *co. device fd0 ( Note that the 0 here is a zero ) [6] Insert the 'kernel' disc in the floppy drive. [7] Press Ctrl and Break together to reread CMOS ram. [8] Click on single user in the RISCiX maintenance menu ( see above ). [9] Insert 'system' disc when prompted. [10] At the # prompt type 'mknewfs' and Return. The mknewfs script is described later in this document. August 1, 1990 Page 6 [11] Type '/etc/halt' and Return. [12] Back at the RISCOS desktop select 'Exit' from the Task Menu displayed by the Task Manager icon. [13] Insert the kernel disk [14] Type 'boot vmunix st0(0,0) st0(0,1)' and Return. ( Note that the 0s here are zeros ) [15] At the # prompt type 'cpsys' and Return. The cpsys script is described later in this document. [16] Insert the 'archive' disc when prompted. [17] Type 'halt' and Return. [18] At the desktop press the F12 key. [19] Type 'co. device st0' and Return. ( Note that the 0 here is a zero ) [20] Press Ctrl and Break together. [21] Click on single user in the RISCiX maintenance menu ( see above ). It will now be necessary to edit ( using vi ) the appropriate files for setting up the network ( /etc/hosts, /etc/rc.net, /etc/rc.config ) and ensure that X windows is de-activated in the /etc/ttys file. Now it should be possible to type Ctrl + D to go multi user and thereafter to mount the network. 7. The mknewfs script The mknewfs script carries out several tasks. First it creates a new filesystem on the drive based on the information in the partition table and the 3065 entry in /etc/disktab. It then mounts the hard disc and creates the following directories : /bin /dev /etc /lib /tmp /mnt /usr /usr/ucb /usr/acorn Mknewfs then copies over all the files contained on the floppy. Then the following devices are created : /dev/console /dev/fdf1024 /dev/rfdf1024 /dev/st0a /dev/st0S /dev/rst0a /dev/rst0S /dev/kmem /dev/null August 1, 1990 Page 7 /dev/cmos /dev/tty /dev/ttyv0 /dev/ttyv1 /dev/ptyp0 /dev/ptyp1 /dev/ptyp2 /dev/ptyp3 /dev/ptyp4 It then creates cut down versions of the following files : /etc/passwd /etc/group /etc/fstab /etc/hosts /.profile Finally it creates the cpsys script. 8. The cpsys script. The cpsys script is responsible for copying across the kernel and uncompressing the Version 1.13 library ( if it exists ) and dsplit. It then uses dsplit to unarchive the archive disc. Finally a new .profile file is created. August 1, 1990