HOW-TO make a Rescue-Disk with two 5 1/4 Floppies
Version 1.0

By Thomas Heiling 

Email heiling@wrzv01.rz.uni-wuerzburg.de

Here is my proposal for all those in Net-world, who want
a Rescue-Disk, because the SLS-Boot Disk ( as in the
version for the 5 1/4 Disk comes with an old Kernel and
- this is the main problem - an old libc).

The biggest Problem is *SPACE* therefore the following !

What You need :
   - Two (MS-DOS) formatted 5 1/4 disks
   - A Kernel-Image, usually /vmlinuz or /zImage
   - A copy of rdev, singleinit, agetty, (optional ksh)
   - Eventually the util-etc-2.1 Package, if you
     have no recent mount or the above files

NEW:
	This file explains, what to do to create a 
	Boot- / Rootdisk Combo.
	The easier way to do this is to take a look
	at the makeboot and makeroot scripts, edit
	it if necessary and start the scripts !!!

	The makeboot scripts should be ok for every
	setup, but the makeroot script is configured
	for a Korn-Shell, simpleinit, agetty and the
	normal ( not the shadow ) password site.
	Therefore you *must* edit it, if you do not have
	these files.

Therefore the ( I hope ) easiest way is the following :
1. Make a Directory TMP which holds all the temporary files
   eg mkdir /usr/tmp/tmp

2. Copy your Kernel-Image to TMP

3. Modify your Kernel-Image
   - to boot from your Floppy
        /etc/rdev TMP/vmlinuz /dev/fd0 
   - to boot the Kernel Read-Only
	/etc/rdev -R TMP/vmlinuz /dev/fd0 1
   - to boot with a RAMDISK with kkk KB ( eg. 1200 KB )
	/etc/rdev -r TMP/vmlinuz 1200
   - optional: boot with asking for the videomode
	/etc/rdev -v TMP/vmlinuz 3

4. Make the Boot-Floppy
   Put a formatted floppy in your 5 1/4 Drive 
	dd if=TMP/vmlinuz of=/dev/fd0 obs=7680

Now you have a bootable Floppy, but no Filesystem.

/*

The other method to obtain a bootable Floppy with LILO
is a little bit complex. Only a hint :
- Make a fs on the floppy
	mkfs.minix -n30 /dev/fd0 1200
- Mount the floppy on (eg) /mnt
	mount -t minix /dev/fd0 /mnt
- Copy a kernel image to /mnt/vmlinuz
- Make the directories /mnt/etc and /mnt/etc/lilo
- cd to /mnt/etc/lilo
- edit the file /mnt/etc/lilo/config as shown

	boot = /dev/fd0
	install = /etc/lilo/boot.b
	delay = 100
	compact
	image = /vmlinuz
		label = LX
		root = /dev/fd0
		read-only
- Test the LILO installation
	/etc/lilo/install -r /mnt -v -v -t
- Make the installation
	/etc/lilo/install -r /mnt -v -v

*/

5. Take the Boot-Floppy out of the Floppy-Drive and
   label it.

6. Put a new formatted Disk in the Floppy-Drive

7. Make a Filesystem on it 
   ( I would propose a MINIX-Filesystem, because an EXT-2 FS
     needs extra space for the lost+found directory )
	/etc/mkfs.minix -c -n30 /dev/fd0 1200

8. Mount the new Filesystem on /mnt
	mount -t minix /dev/fd0 /mnt

9. Change to /mnt and make directories
	cd /mnt
	mkdir auto bin dev etc lib proc tmp usr user

10. Absolutely necessary files in /mnt/bin are
	cp gzip login mkdir mv passwd rm sh
    (I have used the PD-Kornshell as sh, and the 
     normal passwd not the shadow passwd )
    Copy these files to /mnt/bin

12. The next directory is /mnt/dev
    ChangeDir to it and copy your /dev/MAKEDEV to it
    /* If you have no such File you must make the 
       devices per hand with mknod */
    Make the Standard Devices,Hard Disks, Floppy Disks
    Terminals and all Devices for your Setup.
    Normally a MAKEDEV generic should be ok.
	
    BEWARE!! In my MAKEDEV Script are the /dev/ram with a
    major 1 and minor 0. THIS IS IMHO WRONG !!
    It should be major 1 and minor 1.
    If this is the case do a "rm -f ram",
    "mknod -m 660 ram b 1 1" and "chown root.disk ram" 
     
13. Absolutely necessary files in /mnt/etc
agetty*	     halt@	  lilo/	       rc*	    shutdown*	 umount*
brc*	     hostname*	  mkfs.minix*  rc.local*    simpleinit*	 update*
fsck.minix*  init@	  motd	       rdev*	    swapoff@
fstab	     inittab*	  mount*       reboot@	    swapon*
getty@	     issue	  passwd       securetty*   sync*
group	     keys.map.gz  profile*     shells	    termcap

halt and reboot are symlinks to shutdown.
swapoff is a symlink to swapon.

14. If you are using LILO on your Hardrive add a
    directory /mnt/etc/lilo with these files:

	any_d.b	 chain.b  disktab  map	    os2_d.b
	boot.b	 config	  lilo*	   mkck*

15. Copy your /libc-so.4.4.? to /mnt/lib
	Example : With the newest libc.so.4.4.4
	cp /lib/libc.so.4.4.4 /mnt/libc.so.4.4.4

16. Make symbolic links to libc.so.4
	BEWARE!!! You *must* be in /mnt/lib

	ln -sf libc.so.4.4.4 libc.so.4

17. If you use the ld.so pair copy it to /mnt/lib
	cp /lib/ld.so /mnt/lib

18. Now look how much Space is left on the device
	df

19. Copy your Keymap to /mnt/tmp/keys.map and
    compress it with gzip -9 

20. Copy necessary Files to a temporary Directory on
    your Harddrive. Compress it with gzip -9.
    I have done it with these Files :

cat.gz*		doshell.gz*	killall.gz*	mkfs.ext2.gz*	tune2fs.gz*
chmod.gz*	fdisk.gz*	ln.gz*		mkfs.xiafs.gz*	vi.gz*
chown.gz*	fsck.ext2.gz*	loadkeys.gz*	more.gz*
df.gz*		fsck.xiafs.gz*	ls.gz*		rmdir.gz*

21. Move the compressed Files to /mnt/auto 
	( As long as Space permits it )

Now you have a full FileSystem, but you have to
edit the scripts in /mnt/etc:

22. You have to edit these Files in /mnt/etc
        brc, fstab, group, inittab, issue, motd, 
        passwd, profile*, rc, rc.local, securetty, shells, 
       
I will give you my setup for every File :
See it in the makeroot script

23. As a last step you must edit the root Init Files
    These are .profile and .kshrc ( Remember ? I use
    the ksh as sh. As usually because of space ... )
    See it in the makeroot script.
    ( I have omitted the .kshrc script, because you need
      it only for the alias. If you need it, copy the .profile
      to .kshrc )

24. You are finished !!!
    Try it out ...
    /* Boot with your Boot-Floppy,after the Kernel-Request
       to enter the ROOT-DISK put your Root-Disk in the
       floppy-drive and watch for error messages */


P.S.
The whole Thing started, because i wanted to "tune2fs" my
machine at work. OK, No Problem - i thought. Simple boot
the SLS-Disk, copy the tune2fs to it and that's all.
But..., Wrong Library Version ...

After 2 days hack with one Disk, LILO and the EXT2-FS,
i gave up.
There is not enough Space on a 5 1/4 disk...
( I *don't* want learn ed, i need vi or joe !
  And i hate the US-Chars on my German-Keyboard )

Then i tried it with TCX/UNTCX, but after some time
i thought it's overkill. I must have space to expand
the files and the only way is to do it via a RAMDISK.
And if i must have a RAMDISK, i don't need TCX, because
i can unpack all file to it when i modify my Startup
scripts.
Much later ( in the night ... ) i tried it again with
one Disk, but the Kernel Image needs to much space,
therefore i maked it in the described way.
If anyone can show me another way to do it, i would
say much thanks.

Ideas,Flames and critics to heiling@wrzv01.rz.uni-wuerzburg.de

